@import url('https://fonts.googleapis.com/css2?family=Open+Sans:ital,wght@0,300;0,400;0,500;0,600;1,300;1,400&family=Source+Sans+Pro:ital,wght@0,300;0,400;0,600;1,300;1,400&family=Nunito+Sans:ital,wght@0,300;0,400;0,500;0,600;1,300;1,400&display=swap');
@import url('https://fonts.googleapis.com/icon?family=Material+Icons');

:root {
    /* Professional Radiology Dark Theme */
    --primary-dark: #0f1419;
    --secondary-dark: #1a1f2e;
    --tertiary-dark: #252b3a;
    --accent-blue: #64b5f6;
    --accent-teal: #4dd0e1;
    --text-light: #e8eaed;
    --text-dim: #9aa0a6;
    --text-muted: #5f6368;
    --border-color: #3c4043;
    --border-light: #5f6368;
    --success-color: #34a853;
    --danger-color: #ea4335;
    --warning-color: #fbbc04;
    --info-color: #4285f4;
    --prediction-text: #fff3cd;
    
    /* Enhanced contrast for medical precision */
    --surface-1: #1e1e1e;
    --surface-2: #2d2d30;
    --surface-3: #3e3e42;
    
    /* Quill Editor specific colors */
    --quill-toolbar-bg: #2d2d30;
    --quill-toolbar-border: #5f6368;
    --quill-icon-color: #e8eaed;
    --quill-icon-hover: #64b5f6;
    --quill-editor-bg: #1e1e1e;
    
    /* Butterfly Glow Animation Variables */
    --butterfly-glow-color: rgba(100, 181, 246, 0.4);
    --butterfly-glow-base-spread: 6px;
    --butterfly-glow-max-spread: 18px;
    --butterfly-pulse-scale: 1.05;
    
    /* Common repeated values - OPTIMIZATION */
    --font-stack: 'Open Sans', 'Source Sans Pro', 'Nunito Sans', system-ui, sans-serif;
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-ease: all 0.3s ease;
    --shadow-inset: inset 0 2px 4px rgba(0, 0, 0, 0.2);
    --shadow-base: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-hover: 0 4px 12px rgba(0, 0, 0, 0.2);
    --shadow-focus: 0 0 0 3px rgba(100, 181, 246, 0.2);
}

/* Animations */
@keyframes butterfly-pulse {
    0%, 100% {
        box-shadow: 0 0 8px rgba(100, 181, 246, 0.3), 0 0 16px rgba(100, 181, 246, 0.2), 0 0 24px rgba(100, 181, 246, 0.1);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 12px rgba(100, 181, 246, 0.5), 0 0 24px rgba(100, 181, 246, 0.4), 0 0 36px rgba(100, 181, 246, 0.3);
        transform: scale(1.05);
    }
}

@keyframes loading-dot-pulse {
    0%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
        background-color: var(--accent-teal);
    }
    50% {
        transform: scale(1.1);
        opacity: 1;
        background-color: var(--accent-blue);
    }
}

.editor-wrapper {
    display: flex;
    flex-direction: column; /* Stack elements vertically */
    width: 100%;
    position: relative;
    gap: 20px; /* Space between quill2 and main editor */
}

.editor-and-preview-container {
    display: flex;
    flex-direction: row;
    width: 100%;
    gap: 20px;
    justify-content: center;
    align-items: flex-start;
}

.quill-editor-column {
    width: 100%; /* Ensure quill2 takes full width */
}

.main-editor {
    flex: 2; /* Give more space to the editor */
    max-width: 70%; /* Limit width for side-by-side */
    transition: width 0.3s ease;
}

.rewrite-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    opacity: 0;
    visibility: hidden;
    z-index: 1000;
    width: 80%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    background: var(--surface-2);
    box-shadow: 0 8px 32px rgba(0,0,0,0.6);
    display: flex;
    flex-direction: column;
    border: 2px solid var(--accent-blue);
    border-radius: 16px;
    backdrop-filter: blur(10px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.rewrite-popup.active {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
    visibility: visible;
}

.rewrite-popup::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-blue), var(--accent-teal));
    animation: pulse-glow 2s infinite ease-in-out;
}

@keyframes pulse-glow {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}


.rewrite-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    height: 100px;
    margin: 20px 0;
    background-color: var(--surface-1);
    border-radius: 8px;
    padding: 20px;
    border: 1px solid var(--border-color);
}

.loading-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: var(--accent-teal);
    animation: loading-dot-pulse 1.5s infinite ease-in-out;
}

.loading-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.loading-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes pulse {
    from { transform: scale(1); opacity: 1; }
    to { transform: scale(1.08); opacity: 0.9; }
}

/* Base Speech Icon Styles - CONSOLIDATED */
.quill-speech-icon, .tbox-speech-icon, .textbox-speech-icon {
    animation: butterfly-pulse 3s infinite;
    background: var(--surface-2);
    color: var(--accent-teal);
    border: 2px solid var(--accent-teal);
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition-ease);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    position: relative;
    box-shadow: var(--shadow-base);
    font-family: 'Material Icons';
    font-size: 20px;
    user-select: none;
    speak: none;
}

.quill-speech-icon.recording, .tbox-speech-icon.recording, .textbox-speech-icon.recording {
    background: var(--danger-color);
    color: var(--text-light);
    border-color: var(--danger-color);
    animation: pulse 1s infinite alternate;
    box-shadow: 0 0 16px rgba(234, 67, 53, 0.4);
}

.quill-speech-icon.processing, .tbox-speech-icon.processing, .textbox-speech-icon.processing {
    background: var(--info-color);
    color: var(--text-light);
    border-color: var(--info-color);
    animation: pulse 1s infinite alternate;
    box-shadow: 0 0 16px rgba(66, 133, 244, 0.4);
}

.quill-speech-icon:hover, .tbox-speech-icon:hover, .textbox-speech-icon:hover {
    background: var(--accent-blue);
    color: var(--text-light);
    transform: scale(1.05);
    border-color: var(--accent-blue);
    box-shadow: 0 4px 12px rgba(100, 181, 246, 0.3);
}

.quill-speech-icon:active, .tbox-speech-icon:active, .textbox-speech-icon:active {
    transform: scale(0.95);
    box-shadow: var(--shadow-focus);
}

/* Header Styles */
.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    background: var(--secondary-dark);
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 24px;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.site-title {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.site-title h1 {
    color: var(--accent-blue);
    font-size: 24px;
    font-weight: 600;
    margin: 0;
    letter-spacing: 1.2px;
}

.site-subtitle {
    color: var(--text-dim);
    font-size: 14px;
    font-style: italic;
}

.user-access {
    display: flex;
    align-items: center;
    gap: 20px;
}

.token-display {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--surface-2);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.token-label {
    color: var(--text-dim);
    font-size: 14px;
}

.token-value {
    color: var(--accent-teal);
    font-weight: 600;
}

.profile-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--surface-2);
    color: var(--text-light);
    text-decoration: none;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    transition: var(--transition-ease);
}

.profile-link:hover {
    background: var(--surface-3);
    border-color: var(--accent-blue);
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.profile-link .material-icons {
    font-size: 20px;
    color: var(--accent-blue);
}

body {
    background-color: var(--primary-dark);
    color: var(--text-light);
    font-family: var(--font-stack);
    margin: 0;
    padding: 0;
    min-height: 100vh;
    font-weight: 400;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.content-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px 0;
}

.reps-container, .pop-container {
    max-height: 95vh;
    overflow: auto;
    max-width: 1000px;
    margin: 20px auto;
    padding: 24px;
    background: var(--secondary-dark);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 2px 8px rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-light);
    backdrop-filter: blur(10px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.reps-header, .component-header .prediction-ghost {
    text-align: center;
    margin-bottom: 30px;
    position: relative;
}

.prediction-ghost {
    font-family: var(--font-stack);
    font-style: italic;
    font-weight: 300;
    padding-bottom: 8px;
    text-align: center;
    color: var(--prediction-text);
    letter-spacing: 0.5px;
}

.reps-header h2, .component-header h2 {
    color: var(--accent-blue);
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    font-family: var(--font-stack);
}

.reps-header p, .component-header p {
    color: var(--text-dim);
    font-size: 14px;
}

.trial-info {
    margin-top: 15px;
    padding: 12px 20px;
    background: linear-gradient(135deg, rgba(100, 181, 246, 0.1), rgba(77, 208, 225, 0.1));
    border: 1px solid rgba(100, 181, 246, 0.3);
    border-radius: 8px;
    text-align: center;
}

.trial-text {
    color: var(--accent-blue);
    font-size: 13px;
    font-weight: 400;
    letter-spacing: 0.5px;
}

.trial-text strong {
    color: var(--accent-teal);
    font-weight: 600;
}

.reps-list {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: var(--surface-1);
    padding: 20px;
    min-height: 300px;
    box-shadow: var(--shadow-inset);
}

.reps-item {
    max-height: 220px;
    overflow-y: hidden;
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition-smooth);
    cursor: pointer;
    background: var(--surface-2);
    border-radius: 8px;
    margin-bottom: 12px;
    border-left: 3px solid transparent;
}

.reps-item:hover {
    background: var(--surface-3);
    transform: translateX(6px);
    border-left-color: var(--accent-blue);
    box-shadow: var(--shadow-hover);
}

.loading-state, .empty-state {
    text-align: center;
    padding: 20px;
    color: var(--text-dim);
    font-style: italic;
}

.empty-state { padding: 40px 20px; }

.pagination-controls {
    margin-top: 20px;
    text-align: center;
}

/* Consolidated Button Styles - OPTIMIZATION */
.pagination-btn, .add-row-btn, .add-patient-btn {
    padding: 10px 20px;
    background: var(--accent-blue);
    margin-bottom: 12px;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    font-family: var(--font-stack);
    transition: var(--transition-ease);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.add-patient-btn, .add-row-btn {
    background: var(--success-color);
    border-radius: 24px;
    box-shadow: 0 2px 8px rgba(52, 168, 83, 0.3);
}

.add-patient-btn { width: 100%; margin-top: 16px; }

.pagination-btn:hover:not(:disabled), .add-row-btn:hover, .add-patient-btn:hover {
    transform: translateY(-2px);
}

.pagination-btn:hover:not(:disabled) { background: #357abd; }
.add-row-btn:hover, .add-patient-btn:hover {
    background: #27ae60;
    box-shadow: 0 4px 12px rgba(52, 168, 83, 0.4);
}

.add-row-btn:active, .add-patient-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 4px rgba(52, 168, 83, 0.3);
}

.pagination-btn:disabled {
    background: var(--border-color);
    cursor: not-allowed;
    opacity: 0.7;
}

.page-indicator {
    margin: 0 15px;
    font-size: 14px;
    color: var(--text-dim);
}

.list-container {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: var(--surface-1);
    padding: 24px;
    max-width: 200mm;
    margin: 0 auto;
    overflow-y: auto;
    box-shadow: var(--shadow-inset), 0 4px 12px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: relative;
    transition: var(--transition-smooth);
}

.list-container:hover {
    box-shadow: var(--shadow-inset), 0 8px 24px rgba(0, 0, 0, 0.2);
    transform: translateY(-4px);
}

.list-header {
    display: flex;
    align-items: center;
    padding: 18px;
    border-bottom: 2px solid var(--border-color);
    background: var(--surface-2);
    border-radius: 8px 8px 0 0;
    color: var(--accent-blue);
    text-transform: uppercase;
    letter-spacing: 1.2px;
    font-weight: 600;
    font-size: 14px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.header-left, .header-right {
    flex: 1;
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.header-middle {
    width: 120px;
    text-align: center;
    color: var(--text-dim);
    font-style: italic;
    font-size: 12px;
    padding: 0 10px;
}

.list-item {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 15px;
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    background: var(--surface-2);
    transition: var(--transition-smooth);
    border-radius: 8px;
    position: relative;
    overflow: hidden;
}

.list-item:hover {
    background: var(--surface-3);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
    z-index: 1;
    border-left: 3px solid var(--accent-blue);
}

.list-item:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.1s ease;
}

.list-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 4px;
    background: transparent;
    transition: background 0.3s ease;
}

.list-item:hover::before {
    background: var(--accent-blue);
}

/* Consolidated Form Styles - OPTIMIZATION */
.form-group, .patient-info-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group input[type="text"], .form-group input[type="password"] {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: var(--surface-3);
    color: var(--text-light);
    font-family: var(--font-stack);
    font-size: 14px;
    transition: var(--transition-smooth);
}

.form-group input[type="text"]:focus, .form-group input[type="password"]:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: var(--shadow-focus);
}


.form-group label, .patient-info-item label {
    font-size: 12px;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.patient-info-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
    background: var(--surface-2);
    padding: 24px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-inset);
    margin-bottom: 20px;
}

.patient-info-item input[type="text"], .patient-info-item input[type="number"] {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: var(--surface-3);
    color: var(--text-light);
    font-family: var(--font-stack);
    font-size: 14px;
    transition: var(--transition-smooth);
}

.patient-info-item input[type="text"]:focus, .patient-info-item input[type="number"]:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: var(--shadow-focus);
}

.patient-info-item .gender-radio-group {
    display: flex;
    gap: 16px;
    align-items: center;
}

.patient-info-item .gender-radio-group label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: var(--text-light);
    text-transform: none;
    letter-spacing: normal;
    cursor: pointer;
}

.patient-info-item .gender-radio-group input[type="radio"] {
    appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    outline: none;
    background: var(--surface-3);
    margin-right: 6px;
    cursor: pointer;
    transition: var(--transition-ease);
}

.patient-info-item .gender-radio-group input[type="radio"]:checked {
    border-color: var(--accent-blue);
    background: var(--accent-blue);
    box-shadow: var(--shadow-focus);
}

/* Consolidated Textbox Styles - OPTIMIZATION */
.reg-textbox, .left-textbox, .right-textbox {
    height: fit-content;
    padding: 14px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    font-family: var(--font-stack);
    font-weight: 400;
    line-height: 1.5;
    background: var(--surface-2);
    color: var(--text-light);
    transition: var(--transition-smooth);
    flex: 1;
    resize: vertical;
    overflow: auto;
    box-sizing: border-box;
    box-shadow: var(--shadow-inset), 0 2px 6px rgba(0, 0, 0, 0.1);
    position: relative;
}

.reg-textbox { min-height: 40px; }
.left-textbox, .right-textbox { min-height: 120px; }

.left-textbox::placeholder, .right-textbox::placeholder, .reg-textbox::placeholder {
    color: var(--text-muted);
    font-style: italic;
    opacity: 0.7;
}

.left-textbox:hover, .right-textbox:hover, .reg-textbox:hover {
    border-color: var(--accent-teal);
    box-shadow: var(--shadow-inset), 0 4px 12px rgba(77, 208, 225, 0.2);
}

.left-textbox:focus, .right-textbox:focus, .reg-textbox:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: var(--shadow-focus), var(--shadow-inset);
    background: var(--surface-2);
}

.mobile-group .input-group {
    display: flex;
    gap: 10px;
    align-items: center;
}

.country-code {
    padding: 10px 12px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: var(--surface-2);
    color: var(--text-light);
    font-family: var(--font-stack);
    font-size: 14px;
    transition: var(--transition-smooth);
    cursor: pointer;
    min-width: 120px;
    box-shadow: var(--shadow-inset);
}

.country-code:hover {
    border-color: var(--accent-teal);
    box-shadow: var(--shadow-inset), 0 4px 12px rgba(77, 208, 225, 0.2);
}

.country-code:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: var(--shadow-focus), var(--shadow-inset);
    background: var(--surface-2);
}

.country-code option {
    background: var(--surface-2);
    color: var(--text-light);
    padding: 8px;
}

.button-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0;
    flex-shrink: 0;
    gap: 10px;
}

.action-btn {
    padding: 8px 12px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: var(--transition-ease);
    min-width: 34px;
    width: auto;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    background: var(--secondary-dark);
}

.transfer-btn {
    height: fit-content;
    background: var(--accent-blue);
    padding: 8px 16px;
    border: none;
    border-radius: 18px;
    color: var(--text-light);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 1px;
    transition: var(--transition-smooth);
    width: auto;
    max-width: 300px;
    box-shadow: 0 4px 12px rgba(100, 181, 246, 0.3);
}

.transfer-btn:hover {
    background: #357abd;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(100, 181, 246, 0.4);
}

.transfer-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(100, 181, 246, 0.3);
}

.edit-btn {
    background: var(--warning-color);
}

.edit-btn:hover {
    background: #d68910;
    transform: scale(1.05);
}

.delete-btn {
    background: var(--danger-color);
}

.delete-btn:hover {
    background: #c0392b;
    transform: scale(1.05);
}

.add-row-container {
    margin-top: 24px;
    text-align: center;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.below-editor-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 20px;
    position: relative;
}

.list-container {
    clear: both;
    margin-top: 0;
    margin-bottom: 20px;
    position: relative;
    top: 0;
    left: 0;
    width: 100%;
}

/* Quill Editor Custom Styles - Enhanced for Professional Use */
#editor-container {
    min-height: 100mm;
    background: var(--quill-editor-bg);
    border-radius: 12px;
    margin-bottom: 20px;
    border: 2px solid var(--quill-toolbar-border);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.ql-toolbar {
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
    background: var(--quill-toolbar-bg) !important;
    border-color: var(--quill-toolbar-border) !important;
    border-bottom: 2px solid var(--quill-toolbar-border) !important;
    padding: 12px 16px;
}

.ql-container {
    border-bottom-left-radius: 10px;
    border-bottom-right-radius: 10px;
    background: var(--quill-editor-bg) !important;
    border-color: var(--quill-toolbar-border) !important;
    color: var(--text-light) !important;
    font-size: 14px;
    line-height: 1.6;
}

/* Enhanced Quill Toolbar Icons */
.ql-toolbar .ql-stroke {
    stroke: var(--quill-icon-color) !important;
}

.ql-toolbar .ql-fill {
    fill: var(--quill-icon-color) !important;
}

.ql-toolbar .ql-picker-label {
    color: var(--quill-icon-color) !important;
}

.ql-toolbar button:hover .ql-stroke {
    stroke: var(--quill-icon-hover) !important;
}

.ql-toolbar button:hover .ql-fill {
    fill: var(--quill-icon-hover) !important;
}

.ql-toolbar button:hover {
    background: rgba(100, 181, 246, 0.1) !important;
    border-radius: 4px;
}

.ql-toolbar button.ql-active {
    background: rgba(100, 181, 246, 0.2) !important;
    border-radius: 4px;
}

.ql-toolbar button.ql-active .ql-stroke {
    stroke: var(--accent-blue) !important;
}

.ql-toolbar button.ql-active .ql-fill {
    fill: var(--accent-blue) !important;
}
    /* min-height: 400px; */

/* Quill Editor Content Styling */
.ql-editor {
    padding: 20px !important;
    max-width: 210mm;
    width: 100%;
    margin: 0 auto;
    aspect-ratio: 1 / 1.414;
    font-family: var(--font-stack) !important;
    box-sizing: border-box;
    background: var(--surface-2);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    border-radius: 8px;
}

.ql-editor::before {
    color: var(--text-muted) !important;
    font-style: italic;
}

/* Medical/Radiology Theme Elements */
.reps-container::before, .pop-container::before {
    content: '';
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    bottom: 10px;
    background: linear-gradient(45deg, rgba(74, 144, 226, 0.1) 0%, transparent 100%);
    border-radius: 10px;
    pointer-events: none;
}

.reps-container.hidden {
    opacity: 0;
    transform: scale(0.95);
    pointer-events: none;
}

.pop-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    opacity: 0;
    visibility: hidden;
    z-index: -1;
    max-width: 90vw;
    max-height: 90vh;
    width: 1000px;
    height: auto;
    overflow-y: auto;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.pop-container.active {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
    visibility: visible;
    z-index: 10;
}

.pop-header {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    margin-bottom: 20px;
}

.back-btn {
    align-self: flex-start;
    margin-bottom: 15px;
    background: var(--accent-blue);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 8px 16px;
    cursor: pointer;
    transition: var(--transition-ease);
}

.back-btn:hover {
    background: #357abd;
    transform: translateX(-5px);
}

.list-container::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 50px;
    height: 50px;
    background: radial-gradient(circle, rgba(74, 144, 226, 0.2) 0%, transparent 70%);
    pointer-events: none;
}

/* Imaging Type Toggle Styles */
.imaging-toggle-container {
    display: flex;
    justify-content: center;
    margin-bottom: 15px;
}

.imaging-toggle-btn {
    background-color: var(--surface-2);
    border: 2px solid var(--border-color);
    color: var(--text-dim);
    padding: 10px 18px;
    margin: 0 6px;
    cursor: pointer;
    transition: var(--transition-smooth);
    border-radius: 8px;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    font-size: 12px;
    font-weight: 600;
    font-family: var(--font-stack);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.imaging-toggle-btn.active {
    background-color: var(--accent-blue);
    color: var(--text-light);
    border-color: var(--accent-blue);
    box-shadow: var(--shadow-focus), 0 4px 12px rgba(100, 181, 246, 0.2);
    transform: translateY(-3px);
}

.imaging-toggle-btn:hover {
    background-color: var(--surface-3);
    color: var(--accent-blue);
    border-color: var(--accent-blue);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

/* Speech Recording Button Styles */
#speechRecordButton {
    padding: 12px 24px;
    background: var(--success-color);
    color: var(--text-light);
    border: 2px solid var(--success-color);
    border-radius: 8px;
    cursor: pointer;
    margin: 12px;
    transition: var(--transition-smooth);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 4px 12px rgba(52, 168, 83, 0.3);
}

/* Subscription Button Container Styles - Inspired by landing-grok.html .cta-button */
.subscription-button-container {
    background-color: var(--accent-teal); /* Use accent-teal for background */
    color: var(--primary-dark); /* Text color for contrast */
    padding: 14px 35px; /* Padding similar to cta-button */
    border-radius: 25px; /* Rounded corners */
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem; /* Font size */
    transition: var(--transition-smooth); /* Smooth transitions */
    display: inline-block; /* Make it behave like a button */
    box-shadow: var(--shadow-base); /* Base shadow */
    border: 2px solid transparent; /* Transparent border */
    position: relative;
    overflow: hidden;
    text-align: center; /* Center content */
    margin: 15px auto; /* Center the block */
    max-width: 300px; /* Max width */
}

.subscription-button-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(120deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: var(--transition-smooth);
}

.subscription-button-container:hover {
    background-color: var(--accent-blue); /* Hover background color */
    transform: translateY(-2px); /* Lift effect on hover */
    box-shadow: var(--shadow-hover); /* Larger shadow on hover */
    border-color: var(--text-light); /* Border color on hover */
}

.subscription-button-container:hover::before {
    left: 100%; /* Slide effect on hover */
}

/* Style for the Razorpay form within the container */
.subscription-button-container form {
    margin: 0; /* Remove default form margin */
    padding: 0; /* Remove default form padding */
    display: inline-block; /* Ensure form doesn't take full width */
}

/* Style for the Razorpay button itself (if possible, though limited) */
.subscription-button-container .razorpay-payment-button {
    background: none !important; /* Override Razorpay's background */
    color: var(--primary-dark) !important; /* Override Razorpay's text color */
    padding: 0 !important; /* Remove Razorpay's padding */
    border: none !important; /* Remove Razorpay's border */
    font-size: 1.1rem !important; /* Match container font size */
    font-weight: 600 !important; /* Match container font weight */
    cursor: pointer !important;
    transition: none !important; /* Disable Razorpay's transitions */
    box-shadow: none !important; /* Remove Razorpay's shadow */
    text-transform: none !important; /* Remove Razorpay's text transform */
}

.subscription-button-container:hover .razorpay-payment-button {
     color: var(--primary-dark) !important; /* Ensure text color stays dark on hover */
}

/* A4 Preview Specific Styles */
.a4-page {
    font-size: 11px;
}