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

/* Utility classes for mobile */
.mobile-only {
    display: none;
}

.desktop-only {
    display: block;
}

@media (max-width: 575.98px) {
    .mobile-only {
        display: block;
    }
    
    .desktop-only {
        display: none;
    }
    
    .mobile-full-width {
        width: 100% !important;
    }
    
    .mobile-text-center {
        text-align: center !important;
    }
    
    .mobile-padding {
        padding: 1rem !important;
    }
    
    .mobile-margin-bottom {
        margin-bottom: 1rem !important;
    }
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Inter', Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #1a1a1a;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Navbar */
.navbar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    padding: 1rem 0;
    margin-bottom: 2rem;
    position: relative;
    z-index: 1000;
    border-bottom: 1px solid rgba(0, 123, 255, 0.1);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-decoration: none;
    transition: transform 0.2s ease;
}

.logo:hover {
    transform: scale(1.05);
}

.nav-links {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.nav-links a {
    color: #333;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: background 0.2s;
}

.nav-links a:hover {
    background: #f0f0f0;
}

/* Mobile Menu Toggle (Hamburger) */
.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 30px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
}

.menu-toggle span {
    width: 100%;
    height: 3px;
    background: #333;
    border-radius: 3px;
    transition: all 0.3s ease;
    transform-origin: center;
}

.menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(8px, -8px);
}

/* Mobile Sidebar */
.mobile-sidebar {
    position: fixed;
    top: 0;
    left: -280px;
    width: 280px;
    height: 100vh;
    background: #fff;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    transition: left 0.3s ease;
    z-index: 1002;
    overflow-y: auto;
    padding-top: 70px;
}

.mobile-sidebar.active {
    left: 0;
}

.mobile-sidebar .sidebar-header {
    padding: 1rem;
    border-bottom: 1px solid #e9ecef;
    margin-bottom: 1rem;
}

.mobile-sidebar .sidebar-header .logo {
    font-size: 1.25rem;
    display: block;
    margin-bottom: 0.5rem;
}

.mobile-sidebar .sidebar-nav {
    display: flex;
    flex-direction: column;
    padding: 0;
}

.mobile-sidebar .sidebar-nav a {
    display: block;
    padding: 1rem 1.5rem;
    color: #333;
    text-decoration: none;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.2s;
    font-size: 1rem;
}

.mobile-sidebar .sidebar-nav a:hover,
.mobile-sidebar .sidebar-nav a.active {
    background: #f8f9fa;
    color: #007bff;
}

.mobile-sidebar .sidebar-nav .btn-secondary {
    margin: 1rem 1.5rem;
    width: calc(100% - 3rem);
    text-align: center;
    padding: 0.75rem;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
}

.mobile-sidebar .sidebar-nav .btn-secondary:hover {
    background: #5a6268;
}

/* Overlay for mobile sidebar */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1001;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

/* Auth Pages */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 200px);
    padding: 2rem;
}

.auth-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 2.5rem;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    max-width: 500px;
    width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: transform 0.3s ease;
}

.auth-card:hover {
    transform: translateY(-2px);
}

.auth-card h1 {
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
}

.subtitle {
    color: #666;
    margin-bottom: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.9);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    background: white;
}

.form-group small {
    display: block;
    margin-top: 0.5rem;
    color: #666;
    font-size: 0.875rem;
}

.auth-info {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #eee;
}

.auth-info h3 {
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.auth-info ul {
    list-style: none;
    padding-left: 0;
}

.auth-info li {
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
}

.auth-info li:before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #007bff;
    font-weight: bold;
}

.auth-footer {
    margin-top: 2rem;
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid #eee;
}

.auth-footer a {
    color: #007bff;
    text-decoration: none;
}

/* Token Display */
.token-display-container {
    text-align: center;
    padding: 1rem 0;
}

.success-icon {
    font-size: 4rem;
    color: #28a745;
    margin-bottom: 1rem;
}

.token-display-container h2 {
    color: #28a745;
    margin-bottom: 0.5rem;
}

.token-box {
    background: #f8f9fa;
    border: 2px solid #007bff;
    border-radius: 8px;
    padding: 1.5rem;
    margin: 2rem 0;
    text-align: left;
}

.token-box label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: #333;
}

.token-input-group {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.token-input {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    background: white;
    cursor: text;
}

.token-input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.btn-copy {
    padding: 0.75rem 1.5rem;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.2s;
    white-space: nowrap;
}

.btn-copy:hover {
    background: #0056b3;
}

.token-hint {
    display: block;
    color: #666;
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

.token-warning {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 8px;
    padding: 1rem;
    margin: 1.5rem 0;
    text-align: left;
    color: #856404;
}

.token-warning strong {
    display: block;
    margin-bottom: 0.5rem;
}

.token-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.token-actions .btn-primary,
.token-actions .btn-secondary {
    width: auto;
    min-width: 200px;
}

/* Buttons */
.btn-primary,
.btn-secondary {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    width: 100%;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    transition: all 0.3s ease;
    border: none;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

.btn-secondary {
    background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%);
    color: white;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(108, 117, 125, 0.3);
    transition: all 0.3s ease;
    border: none;
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(108, 117, 125, 0.4);
    background: linear-gradient(135deg, #5a6268 0%, #6c757d 100%);
}

/* Dashboard */
.dashboard-header {
    margin-bottom: 2rem;
}

.dashboard-header h1 {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
    font-weight: 700;
    font-size: 2.5rem;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 2rem;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.15);
}

.card h2 {
    margin-bottom: 1.5rem;
    color: #333;
}

.action-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.action-buttons .btn-primary {
    width: auto;
}

.success {
    color: #28a745;
    padding: 0.5rem;
    background: #d4edda;
    border-radius: 4px;
    margin-top: 1rem;
}

/* Footer */
footer {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white;
    padding: 2rem 0;
    margin-top: 4rem;
    text-align: center;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.1);
}

/* Feedback Cards */
.feedbacks-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.feedback-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.feedback-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    border-color: rgba(102, 126, 234, 0.3);
}

.feedback-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.feedback-type {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.feedback-status {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 500;
    text-transform: capitalize;
}

.status-pending {
    background: #ffc107;
    color: #000;
}

.status-reviewed {
    background: #17a2b8;
    color: white;
}

.status-resolved {
    background: #28a745;
    color: white;
}

.feedback-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0 0 0.75rem 0;
    color: #333;
}

.feedback-content {
    color: #666;
    line-height: 1.6;
    margin: 0 0 1rem 0;
}

.feedback-footer {
    border-top: 1px solid #e9ecef;
    padding-top: 0.75rem;
}

.feedback-date {
    color: #999;
    font-size: 0.875rem;
}

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #666;
}

.empty-state p {
    font-size: 1.1rem;
}

.loading {
    text-align: center;
    padding: 2rem;
    color: #666;
}

.error {
    color: #dc3545;
    padding: 0.5rem;
    background: #f8d7da;
    border-radius: 4px;
    margin-top: 1rem;
}

/* Mood Tracking Styles */
.quote-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    margin-bottom: 2rem;
}

.quote-card h2 {
    color: white;
    margin-bottom: 1rem;
}

.quote-content {
    text-align: center;
    padding: 1rem 0;
}

.quote-text {
    font-size: 1.5rem;
    font-style: italic;
    margin: 1rem 0;
    line-height: 1.6;
}

.quote-author {
    display: block;
    margin-top: 1rem;
    font-size: 1rem;
    opacity: 0.9;
}

.quote-note {
    display: block;
    margin-top: 0.5rem;
    opacity: 0.8;
}

.score-display {
    text-align: center;
    font-size: 1.5rem;
    font-weight: bold;
    color: #007bff;
    margin: 0.5rem 0;
}

input[type="range"] {
    width: 100%;
    height: 8px;
    border-radius: 5px;
    background: #ddd;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #007bff;
    cursor: pointer;
}

input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #007bff;
    cursor: pointer;
    border: none;
}

/* Mobile-friendly range input */
@media (max-width: 575.98px) {
    input[type="range"] {
        height: 10px;
    }
    
    input[type="range"]::-webkit-slider-thumb {
        width: 24px;
        height: 24px;
    }
    
    input[type="range"]::-moz-range-thumb {
        width: 24px;
        height: 24px;
    }
}

.recommendations-box {
    background: #e7f3ff;
    border-left: 4px solid #007bff;
    padding: 1rem;
    margin-top: 1rem;
    border-radius: 4px;
}

.recommendations-box h4 {
    margin-top: 0;
    color: #007bff;
}

.recommendations-content {
    white-space: pre-line;
    line-height: 1.6;
}

.mood-history-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.mood-entry-card {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 1rem;
}

.mood-entry-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.mood-date {
    font-weight: 600;
    color: #333;
}

.mood-type {
    padding: 0.25rem 0.75rem;
    background: #007bff;
    color: white;
    border-radius: 12px;
    font-size: 0.875rem;
}

.mood-score {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-weight: bold;
    font-size: 0.875rem;
}

.score-very_low { background: #dc3545; color: white; }
.score-low { background: #fd7e14; color: white; }
.score-moderate { background: #ffc107; color: #000; }
.score-good { background: #28a745; color: white; }
.score-excellent { background: #20c997; color: white; }

.mood-notes {
    color: #666;
    margin-top: 0.5rem;
    font-style: italic;
}

/* Quiz Styles */
.quiz-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.quiz-card {
    text-align: center;
    transition: transform 0.2s;
}

.quiz-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.quiz-card h3 {
    margin-bottom: 0.5rem;
    color: #007bff;
}

.quiz-form {
    max-width: 800px;
    margin: 0 auto;
}

.quiz-description {
    color: #666;
    margin-bottom: 2rem;
}

.quiz-question {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.question-label {
    display: block;
    font-weight: 600;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.radio-option {
    margin: 0.75rem 0;
}

.radio-option input[type="radio"] {
    margin-right: 0.5rem;
}

.radio-option label {
    cursor: pointer;
    font-size: 1rem;
}

.scale-input {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 0.5rem;
}

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

.scale-input span {
    font-weight: bold;
    color: #007bff;
    min-width: 40px;
}

.quiz-result {
    padding: 2rem;
    background: #f8f9fa;
    border-radius: 8px;
    text-align: center;
}

.quiz-result p {
    font-size: 1.2rem;
    margin: 1rem 0;
}

.quiz-results-container {
    padding: 2rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    animation: fadeIn 0.3s ease-in;
}

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

.quiz-results-container h2 {
    color: #007bff;
    margin-bottom: 1.5rem;
    font-size: 1.8rem;
}

.loading {
    text-align: center;
    padding: 2rem;
    color: #666;
    font-size: 1.1rem;
}

.loading::after {
    content: '...';
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}

/* ============================================
   MOBILE RESPONSIVE STYLES
   ============================================ */

/* Base mobile styles - apply to all screen sizes */
.container {
    padding: 15px;
}

/* Small devices (phones, 576px and up) */
@media (max-width: 575.98px) {
    .container {
        padding: 10px;
    }
    
    /* Typography */
    h1 {
        font-size: 1.75rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    h3 {
        font-size: 1.25rem;
    }
    
    /* Navbar */
    .navbar {
        padding: 0.75rem 0;
    }
    
    .navbar .container {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding: 0 15px;
    }
    
    .logo {
        font-size: 1.25rem;
    }
    
    /* Hide desktop nav links on mobile */
    .nav-links {
        display: none;
    }
    
    /* Show hamburger menu on mobile */
    .menu-toggle {
        display: flex;
    }
    
    /* Prevent body scroll when sidebar is open */
    body.sidebar-open {
        overflow: hidden;
    }
    
    /* Cards */
    .card {
        padding: 1.25rem;
    }
    
    .card h2 {
        font-size: 1.25rem;
        margin-bottom: 1rem;
    }
    
    /* Dashboard */
    .dashboard-header {
        margin-bottom: 1.5rem;
    }
    
    .dashboard-header h1 {
        font-size: 1.75rem;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    /* Forms */
    .form-group {
        margin-bottom: 1.25rem;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 0.65rem;
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    /* Buttons */
    .btn-primary,
    .btn-secondary {
        padding: 0.65rem 1.25rem;
        font-size: 1rem;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .action-buttons .btn-primary {
        width: 100%;
    }
    
    /* Auth pages */
    .auth-container {
        padding: 1rem;
        min-height: calc(100vh - 150px);
    }
    
    .auth-card {
        padding: 1.5rem;
    }
    
    /* Token display */
    .token-box {
        padding: 1rem;
    }
    
    .token-input-group {
        flex-direction: column;
    }
    
    .token-input {
        margin-bottom: 0.75rem;
    }
    
    .btn-copy {
        width: 100%;
    }
    
    .token-actions {
        flex-direction: column;
    }
    
    .token-actions .btn-primary,
    .token-actions .btn-secondary {
        width: 100%;
        min-width: auto;
    }
    
    /* Quiz styles */
    .quiz-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .quiz-card {
        padding: 1.25rem;
    }
    
    .quiz-form {
        padding: 0;
    }
    
    .quiz-question {
        padding: 1rem;
        margin-bottom: 1.5rem;
    }
    
    .question-label {
        font-size: 1rem;
        margin-bottom: 0.75rem;
    }
    
    .radio-option {
        margin: 0.5rem 0;
    }
    
    .scale-input {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }
    
    .scale-input input[type="range"] {
        width: 100%;
    }
    
    .quiz-results-container {
        padding: 1.25rem;
    }
    
    .quiz-results-container h2 {
        font-size: 1.5rem;
    }
    
    /* Mood tracking */
    .quote-card {
        padding: 1.25rem;
    }
    
    .quote-text {
        font-size: 1.25rem;
    }
    
    .score-display {
        font-size: 1.25rem;
    }
    
    .recommendations-box {
        padding: 1rem;
    }
    
    .recommendations-box h4 {
        font-size: 1rem;
    }
    
    .mood-entry-card {
        padding: 0.75rem;
    }
    
    .mood-entry-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    /* Feedback cards */
    .feedback-card {
        padding: 1rem;
    }
    
    .feedback-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .feedback-title {
        font-size: 1.1rem;
    }
    
    /* Consultation chat */
    .chat-container {
        height: calc(100vh - 180px);
        padding: 0;
    }
    
    .chat-messages {
        padding: 15px;
    }
    
    .message {
        max-width: 85%;
        font-size: 0.9rem;
        padding: 10px 14px;
    }
    
    .chat-input-container {
        flex-direction: column;
    }
    
    .chat-input {
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .send-btn {
        width: 100%;
        padding: 12px;
    }
    
    /* Footer */
    footer {
        padding: 1.5rem 0;
        margin-top: 2rem;
        font-size: 0.875rem;
    }
    
    /* Empty states */
    .empty-state {
        padding: 2rem 1rem;
    }
    
    .empty-state p {
        font-size: 1rem;
    }
}

/* Medium devices (tablets, 768px and up) */
@media (min-width: 576px) and (max-width: 991.98px) {
    .container {
        padding: 15px;
    }
    
    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .quiz-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .nav-links {
        gap: 0.75rem;
    }
    
    .card {
        padding: 1.5rem;
    }
}

/* Large devices (desktops, 992px and up) */
@media (min-width: 992px) {
    .container {
        padding: 20px;
    }
}

/* Extra large devices (large desktops, 1200px and up) */
@media (min-width: 1200px) {
    .container {
        max-width: 1200px;
    }
}

/* Landscape orientation on mobile */
@media (max-width: 767.98px) and (orientation: landscape) {
    .chat-container {
        height: calc(100vh - 150px);
    }
    
    .auth-container {
        min-height: calc(100vh - 120px);
    }
}

/* Touch-friendly elements for mobile */
@media (hover: none) and (pointer: coarse) {
    /* Increase tap target sizes */
    .btn-primary,
    .btn-secondary,
    .btn-copy {
        min-height: 44px; /* iOS recommended minimum */
    }
    
    .nav-links a {
        min-height: 44px;
        display: flex;
        align-items: center;
    }
    
    .radio-option label {
        min-height: 44px;
        display: flex;
        align-items: center;
        padding: 0.5rem 0;
    }
    
    /* Remove hover effects on touch devices */
    .quiz-card:hover {
        transform: none;
    }
    
    .feedback-card:hover {
        box-shadow: none;
    }
}

/* Override inline styles for mobile responsiveness */
@media (max-width: 575.98px) {
    /* Quiz results summary card */
    .card[style*="gradient"] {
        padding: 20px !important;
        margin-bottom: 20px !important;
    }
    
    .card[style*="gradient"] h2 {
        font-size: 1.5rem !important;
        margin-bottom: 15px !important;
    }
    
    .card[style*="gradient"] p {
        font-size: 0.9rem !important;
        margin-bottom: 15px !important;
    }
    
    /* Quiz result cards inside summary */
    .card[style*="gradient"] > div[style*="grid"] {
        grid-template-columns: 1fr !important;
        gap: 15px !important;
    }
    
    .card[style*="gradient"] > div[style*="grid"] > div {
        padding: 15px !important;
    }
    
    .card[style*="gradient"] h4 {
        font-size: 1rem !important;
        margin-bottom: 10px !important;
    }
    
    .card[style*="gradient"] div[style*="inline-block"] {
        padding: 10px 16px !important;
        font-size: 18px !important;
    }
    
    .card[style*="gradient"] span[style*="font-size: 14px"] {
        font-size: 0.85rem !important;
    }
    
    .card[style*="gradient"] div[style*="background: rgba"] {
        padding: 12px !important;
    }
    
    .card[style*="gradient"] h5 {
        font-size: 0.85rem !important;
        margin-bottom: 8px !important;
    }
    
    .card[style*="gradient"] div[style*="font-size: 13px"] {
        font-size: 0.8rem !important;
        line-height: 1.5 !important;
    }
    
    /* Quiz results container */
    .quiz-results-container {
        padding: 15px !important;
    }
    
    .quiz-results-container h2 {
        font-size: 1.5rem !important;
        margin-bottom: 15px !important;
    }
    
    .quiz-results-container .quiz-result {
        padding: 15px !important;
        margin-bottom: 15px !important;
    }
    
    .quiz-results-container div[style*="inline-block"] {
        padding: 8px 16px !important;
        font-size: 20px !important;
    }
    
    .quiz-results-container p[style*="font-size: 18px"] {
        font-size: 1rem !important;
    }
    
    .quiz-results-container .recommendations-box {
        padding: 15px !important;
        margin-top: 15px !important;
    }
    
    .quiz-results-container .recommendations-box h4 {
        font-size: 1rem !important;
        margin-bottom: 15px !important;
    }
    
    .quiz-results-container .recommendations-box div[style*="font-size: 15px"] {
        font-size: 0.9rem !important;
    }
    
    .quiz-results-container div[style*="margin-bottom: 20px"] {
        margin-bottom: 15px !important;
        padding: 12px !important;
    }
    
    .quiz-results-container span[style*="font-size: 20px"] {
        font-size: 18px !important;
    }
    
    .quiz-results-container div[style*="display: flex"] {
        flex-direction: column !important;
        gap: 8px !important;
    }
    
    /* Error messages */
    .error[style*="padding: 20px"] {
        padding: 15px !important;
    }
    
    .error h3 {
        font-size: 1.1rem !important;
    }
    
    /* Loading states */
    .loading[style*="padding: 20px"] {
        padding: 15px !important;
    }
}

/* Tablet adjustments */
@media (min-width: 576px) and (max-width: 991.98px) {
    .card[style*="gradient"] > div[style*="grid"] {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    .card[style*="gradient"] {
        padding: 25px !important;
    }
}

/* Print styles */
@media print {
    .navbar,
    footer,
    .action-buttons,
    .btn-primary,
    .btn-secondary {
        display: none;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #ddd;
        page-break-inside: avoid;
    }
}

