/* CMS-1500 Claim Validator v3.9 (Sarah Edition) - High-Fidelity Styles */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

.medbill-container {
    max-width: 1100px;
    margin: 0 auto;
    font-family: 'Inter', sans-serif;
}

.medbill-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
    margin-bottom: 20px;
    position: relative;
    overflow: visible !important;
}

.cms-1500-form {
    background: #fffafa; /* Professional form background */
    padding: 0;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: visible;
}

.cms-header {
    background: #b10e1e;
    color: white;
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cms-header h2 {
    color: white !important;
    margin: 0;
    font-size: 1.1em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.cms-section-header {
    background: #f8fafc;
    border-bottom: 2px solid #b10e1e;
    padding: 10px 15px;
    font-weight: 700;
    color: #b10e1e;
    font-size: 0.9em;
    text-transform: uppercase;
}

.cms-row {
    display: flex;
    gap: 15px;
    padding: 15px;
    border-bottom: 1px solid #f1f5f9;
}

.cms-col {
    flex: 1;
}

.box-id {
    display: block;
    font-size: 10.5px;
    color: #b10e1e;
    font-weight: 800;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.cms-input {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 13px;
    color: #1e293b;
    transition: all 0.2s;
    background: white;
}

.cms-input:focus {
    border-color: #b10e1e;
    outline: none;
    box-shadow: 0 0 0 3px rgba(177, 14, 30, 0.1);
}

.cms-table {
    width: 100%;
    border-collapse: collapse;
}

.cms-table th {
    background: #f1f5f9;
    color: #475569;
    font-size: 10px;
    font-weight: 700;
    padding: 8px;
    text-align: left;
    text-transform: uppercase;
    border-top: 1px solid #e2e8f0;
    border-bottom: 2px solid #b10e1e;
}

.cms-table td {
    padding: 6px;
    border-bottom: 1px solid #f1f5f9;
}

/* Animations & UI Flourishes */
@keyframes highlight-flash {
    0% { background: #fee2e2; border-color: #ef4444; }
    100% { background: white; border-color: #cbd5e1; }
}

.autofill-flash {
    animation: highlight-flash 2.5s ease-out;
}

/* AI Filled Persistent Highlight */
.field-filled-ai {
    background-color: #fef9c3 !important; /* Light Golden Yellow */
    border-color: #eab308 !important;
    transition: background-color 0.5s ease;
}

/* Responsive Design v3.9.1 - Mobile First & Stacked Overrides */

/* Responsive Table Wrapper */
.cms-table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 20px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
}

@media (max-width: 900px) {
    .medbill-container {
        padding: 0 10px;
    }
}

/* Tablet & Mobile Stacking Breakpoint (WordPress Default) */
@media (max-width: 782px) {
    .cms-row {
        flex-direction: column !important;
        display: flex !important;
        gap: 12px !important;
        padding: 12px !important;
    }

    .cms-row > .cms-col {
        flex: 1 1 100% !important;
        width: 100% !important;
        max-width: 100% !important;
        margin-bottom: 5px;
    }

    .cms-header {
        flex-direction: column !important;
        text-align: center;
        gap: 10px;
    }

    .cms-header div {
        text-align: center !important;
    }

    /* Scaling down Box ID and Labels */
    .box-id {
        font-size: 10px;
    }

    .cms-input {
        font-size: 14px; /* Larger text for mobile readability/touch */
        padding: 10px;
    }

    .cms-table th {
        font-size: 9px;
    }

    /* Handling inline flex groups that should stack on mobile */
    .flex-mobile-stack {
        flex-direction: column !important;
        display: flex !important;
        align-items: flex-start !important;
        width: 100% !important;
    }

    .flex-mobile-stack > * {
        width: 100% !important;
        flex: 1 1 auto !important;
    }
}

/* Extra small screens */
@media (max-width: 480px) {
    .cms-row {
        padding: 10px 8px !important;
    }
    
    .cms-section-header {
        font-size: 0.8em;
    }

    /* Fix Button Sizing */
    .medbill-btn {
        width: 100% !important;
        margin-bottom: 10px;
    }
    
    .medbill-container {
        padding: 0 !important;
        margin: 0 !important;
    }
}

/* Modal Styling */
.medbill-modal-content {
    background: white;
    padding: 0;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
}