/* Base Styles */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    line-height: 1.6;
    color: #333;
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

/* Header Styles */
header {
    margin-bottom: 40px;
    border-bottom: 1px solid #eee;
    padding-bottom: 20px;
    position: relative;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
}

.header-left {
    flex: 1;
}

.header-left h1 {
    color: #d32f2f;
    margin: 0 0 10px 0;
    text-align: left;
}

.header-left p {
    margin: 0;
    text-align: left;
    color: #666;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-shrink: 0;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 500;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.nav-link:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    color: white;
    text-decoration: none;
}

.nav-icon {
    font-size: 16px;
}

.nav-text {
    font-size: 14px;
}

/* Authentication Styles */
.auth-section {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
}

.auth-button {
    background-color: #4285f4;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    font-size: 0.9em;
}

.auth-button:hover {
    background-color: #3367d6;
}

.logout-button {
    background-color: #666;
    font-size: 0.8em;
    padding: 4px 8px;
}

.logout-button:hover {
    background-color: #555;
}

/* Personal Questions Section */
.personal-questions-section {
    background-color: #e3f2fd;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
    border-left: 4px solid #2196f3;
}

.personal-questions-section h3 {
    margin-top: 0;
    color: #1976d2;
}

.personal-question-item {
    background-color: white;
    border-radius: 4px;
    padding: 15px;
    margin-bottom: 15px;
    border: 1px solid #ddd;
}

.personal-question-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

/* Button Styles */
.btn-small {
    padding: 4px 8px;
    font-size: 0.8em;
    border: none;
    border-radius: 3px;
    cursor: pointer;
}

.btn-primary {
    background-color: #2196f3;
    color: white;
}

.btn-primary:hover {
    background-color: #1976d2;
}

.btn-secondary {
    background-color: #666;
    color: white;
}

.btn-secondary:hover {
    background-color: #555;
}

.btn-danger {
    background-color: #f44336;
    color: white;
}

.btn-danger:hover {
    background-color: #d32f2f;
}

.ask-button {
    background-color: #d32f2f;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1em;
    margin-top: 10px;
}

.ask-button:hover {
    background-color: #b71c1c;
}

.trash-button {
    background-color: #f44336;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 5px 10px;
    cursor: pointer;
    font-size: 0.8em;
    margin-left: 10px;
}

.trash-button:hover {
    background-color: #d32f2f;
}

/* Form Styles */
.add-question-form {
    background-color: white;
    border-radius: 4px;
    padding: 15px;
    border: 1px solid #ddd;
    margin-top: 15px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1em;
    box-sizing: border-box;
}

.form-group textarea {
    height: 80px;
    resize: vertical;
}

/* Model Selector */
.model-selector {
    margin-bottom: 15px;
}

.model-selector label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.model-selector select {
    width: 100%;
    padding: 8px;
    border-radius: 4px;
    border: 1px solid #ddd;
    background-color: white;
    font-size: 1em;
}

/* Question Card Styles */
.question-card {
    background-color: #f9f9f9;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.question {
    font-weight: bold;
    font-size: 1.2em;
    margin-bottom: 10px;
}

.context {
    font-style: italic;
    color: #666;
    margin-bottom: 20px;
    font-size: 0.9em;
}

.answer {
    background-color: #fff;
    padding: 15px;
    border-radius: 5px;
    border-left: 4px solid #d32f2f;
}

.meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.8em;
    color: #888;
    margin-top: 15px;
}

/* History Styles */
.history-link {
    display: block;
    text-align: center;
    margin-top: 10px;
    color: #2196F3;
    text-decoration: none;
}

.history-link:hover {
    text-decoration: underline;
}

.history-section {
    margin-top: 40px;
}

.history-section h2 {
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.history-item {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

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

/* Utility Classes */
.loading {
    text-align: center;
    padding: 20px;
    font-style: italic;
    color: #666;
}

.hidden {
    display: none;
}

/* Notification System */
.notification-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    max-width: 400px;
}

.notification {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    margin-bottom: 10px;
    padding: 16px;
    border-left: 4px solid #007bff;
    animation: slideIn 0.3s ease-out;
    position: relative;
}

.notification.success {
    border-left-color: #28a745;
}

.notification.error {
    border-left-color: #dc3545;
}

.notification.warning {
    border-left-color: #ffc107;
}

.notification-title {
    font-weight: bold;
    margin-bottom: 4px;
    color: #333;
}

.notification-message {
    color: #666;
    font-size: 0.9em;
    line-height: 1.4;
}

.notification-close {
    position: absolute;
    top: 8px;
    right: 12px;
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #999;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notification-close:hover {
    color: #333;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* AI Response Display */
.ai-response-container {
    margin-top: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.ai-response-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #dee2e6;
}

.ai-response-model {
    font-weight: bold;
    color: #007bff;
}

.ai-response-time {
    font-size: 0.8em;
    color: #6c757d;
}

.ai-response-content {
    line-height: 1.6;
    color: #333;
    white-space: pre-wrap;
}

.ai-response-actions {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #dee2e6;
    display: flex;
    gap: 10px;
}

.response-action-btn {
    background: #007bff;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8em;
}

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

.response-action-btn.secondary {
    background: #6c757d;
}

.response-action-btn.secondary:hover {
    background: #545b62;
}

/* Schedule Modal Styles */
.schedule-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.schedule-modal-content {
    background: white;
    border-radius: 12px;
    padding: 24px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    animation: modalFadeIn 0.2s ease-out;
}

.schedule-modal h3 {
    margin: 0 0 20px 0;
    color: #333;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.schedule-form-group {
    margin-bottom: 20px;
}

.schedule-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #333;
}

.schedule-form-group select,
.schedule-form-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    box-sizing: border-box;
}

.frequency-custom {
    display: none;
    margin-top: 10px;
}

.frequency-custom.show {
    display: flex;
    gap: 10px;
    align-items: center;
}

.frequency-custom input {
    width: 80px;
}

.frequency-custom select {
    width: 120px;
}

.model-selection {
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 12px;
    max-height: 200px;
    overflow-y: auto;
}

.model-checkbox {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    padding: 6px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.model-checkbox:hover {
    background-color: #f8f9fa;
}

.model-checkbox input[type="checkbox"] {
    margin-right: 10px;
    width: auto;
}

.model-checkbox label {
    margin: 0;
    font-weight: normal;
    cursor: pointer;
    flex: 1;
}

.schedule-preview {
    background-color: #f8f9fa;
    border-radius: 6px;
    padding: 12px;
    margin-top: 15px;
    border-left: 4px solid #007bff;
}

.schedule-preview h4 {
    margin: 0 0 8px 0;
    color: #007bff;
    font-size: 14px;
}

.schedule-preview p {
    margin: 4px 0;
    font-size: 13px;
    color: #666;
}

.schedule-modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.schedule-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.2s;
}

.schedule-btn-primary {
    background-color: #007bff;
    color: white;
}

.schedule-btn-primary:hover {
    background-color: #0056b3;
}

.schedule-btn-secondary {
    background-color: #6c757d;
    color: white;
}

.schedule-btn-secondary:hover {
    background-color: #545b62;
}

.schedule-btn-danger {
    background-color: #dc3545;
    color: white;
}

.schedule-btn-danger:hover {
    background-color: #c82333;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Scheduled Tasks Styles */
.scheduled-tasks-section {
    background-color: #fff3cd;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
    border-left: 4px solid #ffc107;
}

.scheduled-tasks-section h3 {
    margin-top: 0;
    color: #856404;
}

.scheduled-task-item {
    background-color: white;
    border-radius: 4px;
    padding: 15px;
    margin-bottom: 15px;
    border: 1px solid #ddd;
}

.task-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}

.task-question {
    font-weight: bold;
    color: #333;
    flex: 1;
    margin-right: 10px;
}

.task-schedule {
    font-size: 0.8em;
    color: #666;
    text-transform: uppercase;
}

.model-comparison {
    display: grid;
    gap: 10px;
}

.model-comparison-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: white;
    border-radius: 4px;
    border: 1px solid #ddd;
}

.model-name {
    font-weight: bold;
    color: #333;
}

.model-stats {
    display: flex;
    gap: 15px;
    font-size: 12px;
    color: #666;
}

.recent-answers {
    max-height: 300px;
    overflow-y: auto;
}

.recent-answer {
    padding: 10px;
    margin-bottom: 10px;
    background: white;
    border-radius: 4px;
    border: 1px solid #ddd;
}

.recent-answer-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 12px;
    color: #666;
}

.recent-answer-content {
    color: #333;
    line-height: 1.4;
    max-height: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Cooldown notification styles */
.cooldown-message {
    text-align: left;
}

.cooldown-message h4 {
    margin: 0 0 10px 0;
    color: #ff9800;
}

.cooldown-message p {
    margin: 5px 0;
    font-size: 0.9em;
}

.cooldown-actions {
    margin-top: 15px;
    text-align: center;
}

.cooldown-actions button {
    background-color: #2196F3;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
}

.cooldown-actions button:hover {
    background-color: #1976D2;
}

/* Config page styles */
.model-category {
    margin-bottom: 25px;
}

.models-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 15px;
}

.model-item {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    transition: all 0.2s;
    cursor: pointer;
}

.model-item:hover {
    border-color: #2196f3;
    box-shadow: 0 2px 8px rgba(33, 150, 243, 0.1);
}

.model-item.enabled {
    border-color: #4caf50;
    background: #f1f8e9;
}

.model-item.premium-enabled {
    border-color: #ff9800;
    background: #fff8e1;
}

.model-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.model-toggle {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.model-description {
    font-size: 12px;
    color: #666;
    margin-bottom: 8px;
    line-height: 1.3;
}

.model-status {
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 3px;
    display: inline-block;
}

.model-status.free {
    background: #e8f5e8;
    color: #2e7d32;
}

.model-status.premium {
    background: #fff3e0;
    color: #f57c00;
}

.model-status.requires-key {
    background: #ffebee;
    color: #c62828;
}

.api-key-item {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
}

.api-key-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.api-key-provider {
    font-weight: 600;
    color: #333;
}

.api-key-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: monospace;
    font-size: 12px;
}

.api-key-actions {
    margin-top: 10px;
    display: flex;
    gap: 10px;
}

.btn-small.save {
    background: #4caf50;
    color: white;
}

.btn-small.remove {
    background: #f44336;
    color: white;
}

/* Offline Styles */
.offline-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.offline-header {
    text-align: center;
    margin-bottom: 30px;
}

.offline-status {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    border-left: 5px solid #3498db;
}

.offline-status.online {
    border-left-color: #2ecc71;
}

.offline-status.offline {
    border-left-color: #e74c3c;
}

.cached-questions {
    margin-top: 30px;
}

/* Responsive styles */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        align-items: stretch;
    }
    
    .header-nav {
        justify-content: space-between;
        margin-top: 15px;
    }
    
    .nav-text {
        display: none;
    }
    
    .nav-link {
        padding: 8px 12px;
    }
    
    .models-list {
        grid-template-columns: 1fr;
    }
    
    .schedule-modal-content {
        width: 95%;
        margin: 10px;
    }
    
    .model-stats {
        flex-direction: column;
        gap: 5px;
    }
}


/* ===== OFFLINE PAGE STYLES ===== */

/* Offline page specific styles for the download interface and components */
.offline-page * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.offline-page body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

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

.offline-page .header {
    text-align: center;
    color: white;
    margin-bottom: 40px;
}

.offline-page .header h1 {
    font-size: 3rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.offline-page .header p {
    font-size: 1.2rem;
    opacity: 0.9;
}

.offline-page .status-card {
    background: white;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.offline-page .status-indicator {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.offline-page .status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 10px;
}

.offline-page .status-dot.green {
    background-color: #10b981;
}

.offline-page .status-dot.red {
    background-color: #ef4444;
}

.offline-page .status-dot.yellow {
    background-color: #f59e0b;
}

.offline-page .download-section {
    background: white;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.offline-page .download-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.offline-page .option-card {
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.offline-page .option-card:hover {
    border-color: #3b82f6;
    background-color: #f8fafc;
}

.offline-page .option-card.selected {
    border-color: #3b82f6;
    background-color: #eff6ff;
}

.offline-page .option-title {
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 10px;
    color: #1f2937;
}

.offline-page .option-description {
    color: #6b7280;
    margin-bottom: 15px;
}

.offline-page .option-specs {
    font-size: 0.9rem;
    color: #374151;
}

.offline-page .download-btn {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    margin-bottom: 20px;
}

.offline-page .download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(59, 130, 246, 0.3);
}

.offline-page .download-btn:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.offline-page .session-import-section {
    margin-top: 24px;
    padding: 16px;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    background: #f9fafb;
}

.offline-page .session-import-section h3 {
    margin: 0 0 8px 0;
    font-size: 1.1rem;
    color: #111827;
}

.offline-page .session-import-description {
    margin: 0 0 16px 0;
    color: #4b5563;
}

.offline-page .session-import-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.offline-page .session-import-card {
    background: #ffffff;
    border-radius: 10px;
    padding: 14px;
    border: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.offline-page .session-import-card h4 {
    margin: 0;
    font-size: 1rem;
    color: #111827;
}

.offline-page .session-import-card p {
    margin: 0;
    color: #6b7280;
    font-size: 0.9rem;
}

.offline-page .session-import-card input[type="file"] {
    padding: 6px;
    border-radius: 6px;
    border: 1px solid #d1d5db;
    background: #f9fafb;
}

.offline-page .session-import-status {
    font-size: 0.85rem;
    color: #6b7280;
    padding: 6px 8px;
    border-radius: 6px;
    background: #f3f4f6;
}

.offline-page .session-import-status.success {
    background: #dcfce7;
    color: #166534;
}

/* File size styling for download links */
.file-size {
    color: #6b7280;
}

.offline-page .session-import-status.error {
    background: #fee2e2;
    color: #b91c1c;
}

.offline-page .session-import-note {
    margin-top: 12px;
    font-size: 0.85rem;
    color: #6b7280;
}

.offline-page .progress-section {
    display: none;
    margin-top: 20px;
}

.offline-page .progress-bar {
    width: 100%;
    height: 20px;
    background-color: #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 15px;
}

.offline-page .progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #1d4ed8);
    width: 0%;
    transition: width 0.3s ease;
}

.offline-page .progress-text {
    text-align: center;
    font-weight: bold;
    color: #374151;
    margin-bottom: 10px;
}

.offline-page .progress-details {
    font-size: 0.9rem;
    color: #6b7280;
    text-align: center;
}

.offline-page .component-status {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.offline-page .component {
    display: flex;
    align-items: center;
    padding: 10px;
    background: #f9fafb;
    border-radius: 6px;
    border-left: 4px solid #e5e7eb;
}

.offline-page .component.loaded {
    border-left-color: #10b981;
}

.offline-page .component-name {
    font-weight: 500;
    margin-right: 10px;
}

.offline-page .component-progress {
    font-size: 0.9rem;
    color: #6b7280;
}

.offline-page .features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.offline-page .feature-card {
    background: white;
    border-radius: 12px;
    padding: 30px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.offline-page .feature-card:hover {
    transform: translateY(-5px);
}

.offline-page .feature-icon {
    font-size: 3rem;
    margin-bottom: 20px;
}

.offline-page .feature-title {
    font-size: 1.3rem;
    font-weight: bold;
    margin-bottom: 15px;
    color: #1f2937;
}

.offline-page .feature-description {
    color: #6b7280;
    line-height: 1.6;
}

.offline-page .chat-section, 
.offline-page .wiki-section {
    display: none;
    background: white;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.offline-page .chat-container {
    height: 400px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 20px;
    overflow-y: auto;
    margin-bottom: 20px;
    background: #f9fafb;
}

.offline-page .message {
    margin-bottom: 15px;
    padding: 10px 15px;
    border-radius: 8px;
    max-width: 80%;
}

.offline-page .message.user {
    background: #3b82f6;
    color: white;
    margin-left: auto;
}

.offline-page .message.ai {
    background: white;
    border: 1px solid #e5e7eb;
}

.offline-page .chat-input-container {
    display: flex;
    gap: 10px;
}

.offline-page .chat-input {
    flex: 1;
    padding: 12px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 1rem;
}

.offline-page .send-btn, 
.offline-page .stop-btn {
    padding: 12px 20px;
    border: none;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.offline-page .send-btn {
    background: #3b82f6;
    color: white;
}

.offline-page .send-btn:hover {
    background: #2563eb;
}

.offline-page .send-btn:disabled {
    background: #9ca3af;
    cursor: not-allowed;
}

.offline-page .stop-btn {
    background: #ef4444;
    color: white;
    display: none;
}

.offline-page .stop-btn:hover {
    background: #dc2626;
}

.offline-page .wiki-search-container {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.offline-page .wiki-search-input {
    flex: 1;
    padding: 12px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 1rem;
}

.offline-page .wiki-search-btn {
    padding: 12px 20px;
    background: #10b981;
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.offline-page .wiki-search-btn:hover {
    background: #059669;
}

.offline-page .wiki-results {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    max-height: 400px;
    overflow-y: auto;
}

.offline-page .wiki-result {
    padding: 15px;
    border-bottom: 1px solid #e5e7eb;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.offline-page .wiki-result:hover {
    background-color: #f9fafb;
}

.offline-page .wiki-result:last-child {
    border-bottom: none;
}

.offline-page .wiki-title {
    font-weight: bold;
    color: #1f2937;
    margin-bottom: 5px;
}

.offline-page .wiki-summary {
    color: #6b7280;
    font-size: 0.9rem;
}

.offline-page .clear-cache-section {
    background: #fef3c7;
    border: 1px solid #f59e0b;
    border-radius: 12px;
    padding: 30px;
    margin-top: 30px;
    text-align: center;
}

.offline-page .clear-cache-section h3 {
    color: #92400e;
    margin-bottom: 15px;
}

.offline-page .clear-cache-section p {
    color: #78350f;
    margin-bottom: 20px;
}

.offline-page .clear-cache-btn {
    background: #f59e0b;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.offline-page .clear-cache-btn:hover {
    background: #d97706;
}

.offline-page .log-section {
    margin-top: 20px;
}

.offline-page .log-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.offline-page .log-header h3 {
    margin: 0;
    font-size: 1rem;
    color: #374151;
}

.offline-page .log-header button {
    background: #6b7280;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
    cursor: pointer;
}

.offline-page .log-container {
    display: none;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 15px;
    max-height: 300px;
    overflow-y: auto;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
}

.offline-page .log-entry {
    margin-bottom: 5px;
    padding: 3px 0;
}

.offline-page .log-entry.success {
    color: #10b981;
}

.offline-page .log-entry.error {
    color: #ef4444;
}

.offline-page .log-entry.warning {
    color: #f59e0b;
}

.offline-page .log-entry.info {
    color: #374151;
}

.offline-page .log-entry.download {
    color: #3b82f6;
}

.offline-page .log-entry.progress {
    color: #8b5cf6;
}

.offline-page .log-entry.complete {
    color: #10b981;
    font-weight: bold;
}

.offline-page .log-time {
    color: #9ca3af;
    margin-right: 8px;
}

.offline-page .log-icon {
    margin-right: 8px;
}

.offline-page .log-message {
    word-break: break-word;
}

/* Responsive design for offline page */
@media (max-width: 768px) {
    .offline-page .header h1 {
        font-size: 2rem;
    }

    .offline-page .download-options {
        grid-template-columns: 1fr;
    }

    .offline-page .features-grid {
        grid-template-columns: 1fr;
    }

    .offline-page .component-status {
        grid-template-columns: 1fr;
    }
}



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

/* Mobile-first responsive improvements */

/* Extra small devices (phones, 320px and up) */
@media (max-width: 480px) {
    .container {
        padding: 10px;
        max-width: 100%;
    }
    
    .header h1 {
        font-size: 1.5rem;
    }
    
    .header p {
        font-size: 0.9rem;
    }
    
    /* Ensure buttons are touch-friendly (min 44x44px) */
    button, .btn, .nav-link, a.btn {
        min-height: 44px;
        min-width: 44px;
        padding: 12px 16px;
    }
    
    /* Stack navigation vertically on very small screens */
    .header-nav {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    /* Full-width cards */
    .card, .status-card, .option-card {
        width: 100%;
        margin: 10px 0;
    }
    
    /* Readable text sizes */
    body {
        font-size: 16px;
        line-height: 1.5;
    }
    
    /* Modal improvements */
    .modal-content, .schedule-modal-content {
        width: 95%;
        max-height: 90vh;
        margin: 5vh auto;
        overflow-y: auto;
    }
    
    /* Form inputs */
    input, textarea, select {
        font-size: 16px; /* Prevents iOS zoom */
        width: 100%;
        max-width: 100%;
    }
    
    /* Tables scroll horizontally */
    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
}

/* Small devices (large phones, 481px to 767px) */
@media (min-width: 481px) and (max-width: 767px) {
    .container {
        padding: 15px;
    }
    
    .header h1 {
        font-size: 1.75rem;
    }
    
    /* Two-column grid where appropriate */
    .download-options, .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Tablets (768px to 1024px) */
@media (min-width: 768px) and (max-width: 1024px) {
    .container {
        padding: 20px;
        max-width: 90%;
    }
    
    /* Ensure touch targets remain accessible */
    button, .btn, .nav-link {
        min-height: 44px;
    }
}

/* Large screens (1025px and up) */
@media (min-width: 1025px) {
    .container {
        max-width: 1200px;
        margin: 0 auto;
    }
}

/* Print styles */
@media print {
    .header-nav, .btn, button, .modal, .toast-container {
        display: none !important;
    }
    
    body {
        font-size: 12pt;
        color: #000;
        background: #fff;
    }
}

/* Reduced motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .btn, button {
        border: 2px solid currentColor;
    }
    
    a {
        text-decoration: underline;
    }
}


/* Site Navigation */
.site-nav {
    background: #1a1a2e;
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: #fff;
    text-decoration: none;
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a {
    color: #a0a0a0;
    text-decoration: none;
    transition: color 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
    color: #fff;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.nav-toggle span {
    width: 24px;
    height: 2px;
    background: #fff;
    transition: transform 0.2s;
}

/* Breadcrumb */
.breadcrumb {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    color: #6b7280;
}

.breadcrumb a {
    color: #3498db;
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.breadcrumb .separator {
    margin: 0 0.5rem;
    color: #9ca3af;
}

.breadcrumb .current {
    color: #374151;
}

/* Mobile Navigation */
@media (max-width: 768px) {
    .nav-toggle {
        display: flex;
    }
    
    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: #1a1a2e;
        flex-direction: column;
        padding: 1rem;
        gap: 1rem;
    }
    
    .nav-links.open {
        display: flex;
    }
}


/* Download Controls */
.download-controls {
    display: flex;
    gap: 0.75rem;
    margin: 1rem 0;
    justify-content: center;
}

.control-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
}

.pause-btn {
    background: #f59e0b;
    color: white;
}

.pause-btn:hover {
    background: #d97706;
}

.resume-btn {
    background: #10b981;
    color: white;
}

.resume-btn:hover {
    background: #059669;
}

.cancel-btn {
    background: #ef4444;
    color: white;
}

.cancel-btn:hover {
    background: #dc2626;
}

/* Storage Monitor */
.storage-monitor {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1rem;
    margin: 1rem 0;
}

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

.storage-title {
    font-weight: 600;
    color: #334155;
}

.storage-summary {
    font-size: 0.875rem;
    color: #64748b;
}

.storage-bar {
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.storage-fill {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #8b5cf6);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.storage-fill.warning {
    background: linear-gradient(90deg, #f59e0b, #ef4444);
}

.storage-details {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: #64748b;
}

.storage-warning {
    margin-top: 0.5rem;
    padding: 0.5rem;
    background: #fef3c7;
    border: 1px solid #f59e0b;
    border-radius: 4px;
    color: #92400e;
    font-size: 0.875rem;
    text-align: center;
}

@media (max-width: 768px) {
    .download-controls {
        flex-direction: column;
    }
    
    .storage-details {
        flex-direction: column;
        gap: 0.25rem;
    }
}


/* Next Steps Container */
.next-steps-container {
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    border: 2px solid #10b981;
    border-radius: 12px;
    padding: 1.5rem;
    margin: 1.5rem 0;
    display: none;
}

.next-steps-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.next-steps-header .success-icon {
    font-size: 2rem;
}

.next-steps-header h3 {
    margin: 0;
    color: #065f46;
    font-size: 1.5rem;
}

.next-steps-content p {
    color: #047857;
    margin-bottom: 1rem;
}

.next-steps-actions {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.action-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.action-btn.primary {
    background: #10b981;
    color: white;
}

.action-btn.primary:hover {
    background: #059669;
    transform: translateY(-2px);
}

.action-btn.secondary {
    background: white;
    color: #10b981;
    border: 2px solid #10b981;
}

.action-btn.secondary:hover {
    background: #ecfdf5;
}

.next-steps-info {
    background: white;
    border-radius: 8px;
    padding: 1rem;
}

.next-steps-info h4 {
    margin: 0 0 0.5rem 0;
    color: #065f46;
}

.next-steps-info ul {
    margin: 0;
    padding-left: 1.5rem;
    color: #047857;
}

.next-steps-info li {
    margin-bottom: 0.25rem;
}

.test-result {
    margin-top: 1rem;
    padding: 1rem;
    background: white;
    border-radius: 8px;
}

.test-success {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0;
    color: #065f46;
}

.test-complete {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid #d1fae5;
    color: #065f46;
}

.loading-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #10b981;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

@media (max-width: 768px) {
    .next-steps-actions {
        flex-direction: column;
    }
    
    .action-btn {
        width: 100%;
        justify-content: center;
    }
}

/* File size styling for download links */
.file-size {
    color: #6b7280;
}

/* File size styling for download links */
.file-size {
    color: #6b7280;
}
