/* Claim Form - Case Specific Form Items CSS */
/* Smooth CSS Transitions for Hide/Show Sections */
/* Pure CSS - No JavaScript Required for Animations */

/* Documented Losses Toggle - Smooth fade and slide transition */
#documentedLossesToggle {
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    transform: translateY(-10px);
    transition: opacity 0.4s ease-out, max-height 0.4s ease-out, transform 0.4s ease-out, padding 0.4s ease-out, margin 0.4s ease-out;
    padding-top: 0;
    padding-bottom: 0;
    margin-top: 0;
    margin-bottom: 0;
    will-change: opacity, max-height, transform;
}

/* Show containers when visible (remove hidden class) */
#documentedLossesToggle:not(.hidden) {
    opacity: 1;
    max-height: 5000px; /* Large enough to show all content */
    transform: translateY(0);
    padding-top: initial;
    padding-bottom: initial;
    margin-top: initial;
    margin-bottom: initial;
}

/* Use hidden class for explicit control */
#documentedLossesToggle.hidden {
    opacity: 0 !important;
    max-height: 0 !important;
    transform: translateY(-10px) !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    overflow: hidden !important;
}

/* Flat Cash Description - Smooth fade transition */
#flatCashDescription {
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    transform: translateY(-10px);
    transition: opacity 0.4s ease-out, max-height 0.4s ease-out, transform 0.4s ease-out, padding 0.4s ease-out, margin 0.4s ease-out;
    padding-top: 0;
    padding-bottom: 0;
    margin-top: 0;
    margin-bottom: 0;
    will-change: opacity, max-height, transform;
}

/* Show flat cash description when visible */
#flatCashDescription:not(.hidden) {
    opacity: 1;
    max-height: 500px;
    transform: translateY(0);
    padding-top: initial;
    padding-bottom: initial;
    margin-top: initial;
    margin-bottom: initial;
}

/* Use hidden class for explicit control */
#flatCashDescription.hidden {
    opacity: 0 !important;
    max-height: 0 !important;
    transform: translateY(-10px) !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    overflow: hidden !important;
}

/* Table input heights - match form-floating input height */
#documentedLossesTableBody .documented-loss-date,
#documentedLossesTableBody .documented-loss-description,
#documentedLossesTableBody .documented-loss-amount {
    height: 58px !important;
    min-height: 58px !important;
    transition: border-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

#documentedLossesTableBody .documented-loss-description {
    resize: vertical;
}

#documentedLossesTableBody .input-group {
    height: 58px !important;
    transition: border-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

#documentedLossesTableBody .input-group-text {
    height: 58px !important;
    line-height: 58px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 12px !important;
    transition: background-color 0.2s ease-in-out, border-color 0.2s ease-in-out;
}

/* Smooth transitions for form inputs on focus */
#documentedLossesTableBody input:focus,
#documentedLossesTableBody textarea:focus {
    transition: border-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

/* Smooth button hover transitions */
#documentedLossesTableBody .btn {
    transition: background-color 0.2s ease-in-out, border-color 0.2s ease-in-out, transform 0.1s ease-in-out;
}

#documentedLossesTableBody .btn:hover {
    transform: translateY(-1px);
}

#documentedLossesTableBody .btn:active {
    transform: translateY(0);
}

/* Respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    #documentedLossesToggle,
    #flatCashDescription,
    #documentedLossesTableBody .documented-loss-date,
    #documentedLossesTableBody .documented-loss-description,
    #documentedLossesTableBody .documented-loss-amount,
    #documentedLossesTableBody .input-group,
    #documentedLossesTableBody .input-group-text,
    #documentedLossesTableBody .btn {
        transition: none !important;
        animation: none !important;
    }
    
    #documentedLossesToggle:not(.hidden),
    #flatCashDescription:not([style*="display: none"]) {
        transform: none !important;
    }
}

