/**
 * Tutor de Español IA - Complete Fixed Design
 * Version: 3.1 - Bug Fixes Applied
 */

/* ========================================
   ROOT VARIABLES
   ======================================== */

:root {
    /* Primary Colors */
    --primary: #E1241F;
    --primary-dark: #b51915;
    --primary-light: #ff3b36;
    
    /* Secondary Colors */
    --secondary: #F6B406;
    --secondary-dark: #d49a05;
    --secondary-light: #ffd54f;
    
    /* Grays */
    --gray-50: #fafbfc;
    --gray-100: #f4f5f7;
    --gray-200: #e9ecef;
    --gray-300: #dee2e6;
    --gray-400: #ced4da;
    --gray-500: #adb5bd;
    --gray-600: #6c757d;
    --gray-700: #495057;
    --gray-800: #343a40;
    --gray-900: #212529;
    
    /* Status Colors */
    --success: #10b981;
    --error: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;
    
    /* Typography */
    --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    
    /* Spacing */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-7: 28px;
    --space-8: 32px;
}

/* ========================================
   GLOBAL RESET
   ======================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

#tutor-espanol-container {
    font-family: var(--font-family);
    font-size: 16px;
    color: var(--gray-900);
    background: var(--gray-50);
    min-height: 500px;  /* Altezza minima */
    max-height: 80vh;   /* Massimo 80% dell'altezza viewport */
    height: 85vh;       /* Si adatta al contenuto */
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

/* ========================================
   HEADER - FIXED VISIBILITY
   ======================================== */

.tutor-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-4) var(--space-5);
    background: white;
    border-bottom: 2px solid var(--primary);
    min-height: 70px;
    position: relative;
    z-index: 10;
}

.header-left .tutor-logo {
    height: 36px;
    width: auto;
    display: block;
}

.header-center {
    display: flex;
    align-items: center;
    gap: var(--space-4);
}

.user-level-badge {
    padding: 8px 16px;
    background: var(--primary);
    color: white;
    border-radius: 20px;
    font-weight: 600;
    font-size: 14px;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(225, 36, 31, 0.3);
}

.level-a1 { background: #2196F3; }
.level-a2 { background: #4CAF50; }
.level-b1 { background: #FF9800; }
.level-b2 { background: #E91E63; }
.level-c1 { background: #9C27B0; }

.header-right {
    display: flex;
    gap: var(--space-2);
}

.icon-btn {
    width: 40px;
    height: 40px;
    border: 2px solid var(--gray-400);
    border-radius: 10px;
    background: var(--gray-100);  /* Sfondo grigio invece di bianco */
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--gray-700);
}

.icon-btn svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}

.icon-btn:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(225, 36, 31, 0.3);
}

/* ========================================
   MAIN LAYOUT
   ======================================== */

.tutor-main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
    background: linear-gradient(180deg, var(--gray-50) 0%, var(--gray-100) 100%);
}

/* ========================================
   CHAT AREA
   ======================================== */

.tutor-chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Mode Selector - FIXED ACTIVE STATE */
.conversation-mode-selector {
    display: flex;
    gap: var(--space-3);
    padding: var(--space-4) var(--space-5);
    background: white;
    border-bottom: 1px solid var(--gray-200);
}

.mode-btn {
    flex: 1;
    padding: 12px 20px;
    border: 2px solid var(--gray-300);
    border-radius: 12px;
    background: white;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    color: var(--gray-700);
}

.mode-btn:hover {
    border-color: var(--primary);
    background: var(--gray-50);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* Active state - HIGH CONTRAST */
.mode-btn.active {
    background: var(--primary) !important;
    color: white !important;
    border-color: var(--primary) !important;
    box-shadow: 0 4px 12px rgba(225, 36, 31, 0.3) !important;
    transform: scale(1.02);
}

.mode-btn.active:hover {
    background: var(--primary-dark) !important;
}

/* ========================================
   MESSAGES CONTAINER
   ======================================== */

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-7) var(--space-6);
    scroll-behavior: smooth;
}

/* Scrollbar */
.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: var(--gray-400);
    border-radius: 3px;
}

/* ========================================
   MESSAGE BUBBLES - SPACIOUS DESIGN
   ======================================== */

.message {
    display: flex;
    gap: var(--space-4);
    margin-bottom: var(--space-7);
    animation: messageEntry 0.4s ease;
}

@keyframes messageEntry {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Avatar */
.message-avatar {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.tutor-message .message-avatar {
    background: white;
    border: 2px solid var(--gray-200);
}

.user-message .message-avatar {
    background: linear-gradient(135deg, var(--secondary) 0%, var(--secondary-light) 100%);
}

.tutor-avatar-img {
    width: 100%;
    height: 100%;
    border-radius: 10px;
    object-fit: cover;
}

/* Message Content */
.message-content {
    max-width: 65%;
    min-width: 200px;
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

/* THE BUBBLE - SUPER SPACIOUS */
.message-bubble {
    /* GENEROUS PADDING */
    padding: var(--space-5) var(--space-7);
    
    /* MODERN DESIGN */
    border-radius: 20px;
    font-size: 15px;
    line-height: 1.7;
    letter-spacing: 0.3px;
    word-wrap: break-word;
    word-break: break-word;
    
    /* EFFECTS */
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.2s ease;
}

.message-bubble:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

/* Tutor Bubble */
.tutor-message .message-bubble {
    background: white;
    color: var(--gray-800);
    border: 1px solid var(--gray-200);
    border-bottom-left-radius: 6px;
}

/* User Bubble */
.user-message .message-bubble {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border-bottom-right-radius: 6px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* User alignment */
.user-message {
    flex-direction: row-reverse;
}

.user-message .message-content {
    align-items: flex-end;
}

/* Welcome Message */
.welcome-message .message-bubble {
    background: linear-gradient(135deg, white 0%, #fffbeb 100%);
    border: 2px solid var(--secondary);
    padding: var(--space-6) var(--space-7);
    box-shadow: 0 4px 16px rgba(246, 180, 6, 0.15);
}

/* Typography */
.message-bubble strong {
    font-weight: 700;
}

.message-bubble em {
    font-style: italic;
    opacity: 0.95;
}

.message-bubble br {
    display: block;
    content: "";
    margin-top: var(--space-2);
}

/* Message Actions */
.message-actions {
    display: flex;
    gap: var(--space-2);
    margin-top: var(--space-2);
}

.tts-btn,
.translate-btn {
    padding: 8px 12px;
    background: white;
    border: 1px solid var(--gray-300);
    border-radius: 8px;
    color: var(--gray-600);
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 38px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tts-btn:hover,
.translate-btn:hover:not(.translated) {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(225, 36, 31, 0.2);
}

.translate-btn.loading {
    background: var(--warning);
    color: white;
    animation: pulse 1s infinite;
}

.translate-btn.translated {
    background: var(--success);
    color: white;
    cursor: default;
}

/* Translation Box */
.translation-box {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border-left: 4px solid var(--info);
    border-radius: 12px;
    padding: var(--space-4) var(--space-5);
    margin-top: var(--space-3);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.translation-label {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--info);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.translation-text {
    color: var(--gray-800);
    line-height: 1.6;
    font-size: 14px;
}

/* Message Time */
.message-time {
    font-size: 12px;
    color: var(--gray-500);
    margin-top: 4px;
    padding-left: 4px;
}

/* Correction Highlight */
.correction-highlight {
    background: #fff3cd;
    padding: 3px 8px;
    border-radius: 6px;
    border: 1px dashed #ffc107;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-block;
    margin: 0 2px;
}

.correction-highlight:hover {
    background: #ffc107;
    color: white;
}

/* ========================================
   TYPING INDICATOR
   ======================================== */

.typing-indicator {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-4) var(--space-6);
    background: white;
    border-top: 1px solid var(--gray-200);
}

.typing-dots {
    display: flex;
    gap: 6px;
    padding: 8px;
    background: var(--gray-100);
    border-radius: 20px;
}

.typing-dots span {
    width: 10px;
    height: 10px;
    background: var(--gray-500);
    border-radius: 50%;
    animation: typingDot 1.4s infinite;
}

.typing-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingDot {
    0%, 60%, 100% {
        transform: scale(1);
        background: var(--gray-500);
    }
    30% {
        transform: scale(1.3);
        background: var(--primary);
    }
}

.typing-text {
    font-size: 14px;
    color: var(--gray-600);
    font-style: italic;
}

/* ========================================
   INPUT AREA
   ======================================== */

.chat-input-area {
    padding: var(--space-5) var(--space-6);
    background: white;
    border-top: 1px solid var(--gray-200);
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.04);
}

.input-wrapper {
    display: flex;
    gap: var(--space-3);
    align-items: flex-end;
}

.message-input {
    flex: 1;
    padding: 14px 18px;
    border: 2px solid var(--gray-300);
    border-radius: 14px;
    font-size: 15px;
    font-family: var(--font-family);
    resize: none;
    min-height: 52px;
    max-height: 150px;
    background: var(--gray-50);
    transition: all 0.2s ease;
    overflow-y: hidden !important;
    overflow-x: hidden !important;
}

.message-input:focus {
    outline: none;
    border-color: var(--primary);
    background: white;
    box-shadow: 0 0 0 3px rgba(225, 36, 31, 0.1);
}

.message-input::placeholder {
    color: var(--gray-500);
    font-style: italic;
}

.input-actions {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
    align-items: flex-end;
}

.char-counter {
    font-size: 12px;
    color: var(--gray-500);
    font-weight: 500;
    padding: 0 4px;
}

.char-counter.warning {
    color: var(--error);
    font-weight: 700;
}

.send-btn {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: 12px 24px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(225, 36, 31, 0.3);
}

.send-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(225, 36, 31, 0.4);
}

.send-btn:active:not(:disabled) {
    transform: translateY(0);
}

.send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.send-btn svg {
    width: 18px;
    height: 18px;
}

/* ========================================
   SIDEBAR
   ======================================== */

.tutor-sidebar {
    width: 320px;
    background: white;
    border-left: 1px solid var(--gray-200);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.sidebar-section {
    padding: var(--space-6);
    border-bottom: 1px solid var(--gray-200);
}

.sidebar-section h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: var(--space-4);
    color: var(--gray-800);
}

.progress-stats {
    display: flex;
    flex-direction: column;
    gap: var(--space-5);
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stat-label {
    font-size: 14px;
    color: var(--gray-600);
}

.stat-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--gray-900);
}


/* ========================================
   CONNECTION STATUS - HIDDEN
   ======================================== */

.connection-status {
    display: none;
}

/* ========================================
   CORRECTIONS PANEL
   ======================================== */

.corrections-panel {
    position: fixed;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    background: white;
    border: 2px solid var(--secondary);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    max-width: 350px;
    z-index: 100;
}

.corrections-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-4);
    background: var(--secondary-light);
    border-radius: 10px 10px 0 0;
}

.corrections-header h4 {
    font-size: 16px;
    margin: 0;
    color: var(--gray-800);
}

.close-corrections {
    width: 24px;
    height: 24px;
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--gray-600);
}

.corrections-list {
    padding: var(--space-4);
    max-height: 300px;
    overflow-y: auto;
}

.correction-item {
    display: flex;
    gap: var(--space-3);
    margin-bottom: var(--space-4);
    padding-bottom: var(--space-4);
    border-bottom: 1px solid var(--gray-200);
}

.correction-item:last-child {
    border-bottom: none;
}

.correction-number {
    width: 24px;
    height: 24px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    flex-shrink: 0;
}

.correction-text {
    flex: 1;
    font-size: 14px;
    line-height: 1.5;
}

/* ========================================
   MODALS
   ======================================== */

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.show {
    display: flex !important;
}

.modal-content {
    background: white;
    border-radius: 16px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalEntry 0.3s ease;
}

@keyframes modalEntry {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-header {
    padding: 24px;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h2 {
    font-size: 20px;
    font-weight: 700;
    margin: 0;
    color: var(--gray-800);
}

.modal-close {
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    font-size: 28px;
    line-height: 1;
    color: var(--gray-500);
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: var(--gray-100);
    color: var(--primary);
}

.modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

.modal-footer {
    padding: 20px 24px;
    border-top: 1px solid var(--gray-200);
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

/* Settings Form */
.setting-group {
    margin-bottom: 24px;
}

.setting-group:last-child {
    margin-bottom: 0;
}

.setting-group label {
    display: block;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 8px;
    font-size: 15px;
}

.form-control {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--gray-300);
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.2s ease;
    background: white;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(225, 36, 31, 0.1);
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
    cursor: pointer;
}

.speed-control {
    display: flex;
    align-items: center;
    gap: 16px;
}

.speed-control input[type="range"] {
    flex: 1;
}

#speed-value {
    font-weight: 600;
    min-width: 50px;
    text-align: center;
}

.setting-group input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-right: 8px;
    vertical-align: middle;
    cursor: pointer;
}

/* ========================================
   BUTTONS
   ======================================== */

.btn {
    padding: 12px 28px;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    text-align: center;
    min-width: 120px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 2px 8px rgba(225, 36, 31, 0.2);
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(225, 36, 31, 0.3);
}

.btn-secondary {
    background: white;
    color: var(--gray-700);
    border: 2px solid var(--gray-300);
}

.btn-secondary:hover {
    background: var(--gray-100);
    border-color: var(--gray-400);
}
/* ========================================
   TOAST NOTIFICATIONS
   ======================================== */

.toast-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1100;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: 16px 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    min-width: 300px;
    margin-bottom: var(--space-3);
    opacity: 0;
    transform: scale(0.9) translateY(10px);
    transition: all 0.3s ease;
    pointer-events: auto;
}

.toast.show {
    opacity: 1;
    transform: scale(1) translateY(0);
}

.toast-success {
    border-left: 4px solid var(--success);
}

.toast-error {
    border-left: 4px solid var(--error);
}

.toast-warning {
    border-left: 4px solid var(--warning);
}

.toast-info {
    border-left: 4px solid var(--info);
}

.toast-icon {
    font-size: 18px;
}

.toast-message {
    flex: 1;
    font-size: 14px;
    color: var(--gray-800);
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

@media (max-width: 1024px) {
    .tutor-sidebar {
        width: 280px;
    }
    
    .chat-messages {
        padding: var(--space-5) var(--space-4);
    }
    
    .message-content {
        max-width: 70%;
    }
}

@media (max-width: 768px) {
    #tutor-espanol-container {
        height: 100vh;
        border-radius: 0;
    }
    
    .tutor-header {
        flex-wrap: wrap;
        gap: var(--space-2);
        padding: var(--space-3) var(--space-4);
    }
    
    .header-left .tutor-logo {
        height: 30px;
    }
    
    .tutor-main-content {
        flex-direction: column;
    }
    
    .tutor-sidebar {
        width: 100%;
        border-left: none;
        border-top: 2px solid var(--gray-200);
        max-height: 40vh;
    }
    
    .chat-messages {
        padding: var(--space-4) var(--space-3);
    }
    
    .message {
        gap: var(--space-3);
        margin-bottom: var(--space-5);
    }
    
    .message-content {
        max-width: 80%;
    }
    
    .message-bubble {
        padding: var(--space-4) var(--space-5);
        font-size: 14px;
    }
    
    .message-avatar {
        width: 36px;
        height: 36px;
    }
    
    .tutor-avatar-img {
        width: 36px;
        height: 36px;
    }
    
    .message-actions {
        opacity: 1;
        transform: none;
    }
    
    .modal-content {
        width: 100%;
        max-width: 100%;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
        margin: 0;
    }
    
    .corrections-panel {
        right: 10px;
        left: 10px;
        transform: translateY(-50%) translateX(0);
        max-width: none;
    }
    
    .chat-input-area {
        padding: var(--space-4);
    }
    
    .message-input {
        padding: 12px 16px;
        font-size: 14px;
    }
    
    .send-btn {
        padding: 10px 20px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .conversation-mode-selector {
        flex-direction: column;
        padding: var(--space-3);
    }
    
    .mode-btn {
        width: 100%;
    }
    
    .chat-messages {
        padding: var(--space-3) var(--space-2);
    }
    
    .message {
        margin-bottom: var(--space-4);
    }
    
    .message-content {
        max-width: 85%;
        min-width: 160px;
    }
    
    .message-bubble {
        padding: var(--space-3) var(--space-4);
        font-size: 14px;
        border-radius: 16px;
    }
    
    .welcome-message .message-bubble {
        padding: var(--space-4) var(--space-5);
    }
    
    .message-actions {
        margin-top: 6px;
    }
    
    .tts-btn,
    .translate-btn {
        padding: 6px 10px;
        min-width: 34px;
        height: 30px;
        font-size: 14px;
    }
}

/* ========================================
   UTILITIES
   ======================================== */

.hidden { 
    display: none !important; 
}

/* Animations */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Focus Styles */
*:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Fullscreen Mode */
#tutor-espanol-container:fullscreen {
    height: 100vh;
    border-radius: 0;
}

/* iOS Safari fixes */
.modal-content {
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
}

.modal-body {
    overscroll-behavior: contain;
}

/* Body scroll lock */
body.modal-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
}

/* Print Styles */
@media print {
    .tutor-header,
    .tutor-sidebar,
    .chat-input-area,
    .conversation-mode-selector,
    .tts-btn,
    .translate-btn,
    .icon-btn {
        display: none !important;
    }
    
    .chat-messages {
        padding: 0;
        background: white;
    }
}