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

:root {
    /* Primary theme colors */
    --primary-color: #4169E1;
    --primary-color-rgb: 65, 105, 225;
    --primary-hover: #3154b3;
    --primary-color-light: #6384e7;
    --primary-color-dark: #2a4fc7;
    
    /* Secondary colors */
    --secondary-color: #f8f9fa;
    --secondary-color-rgb: 248, 249, 250;
    --accent-color: #fb8a58;
    --accent-color-rgb: 251, 138, 88;
    
    /* Text colors */
    --text-color: #333;
    --text-color-rgb: 51, 51, 51;
    --text-light: #6c757d;
    --text-light-rgb: 108, 117, 125;
    --text-primary: #111827;
    --text-secondary: #6B7280;
    
    /* UI colors */
    --border-color: #e1e1e1;
    --background-color: #f5f7fa;
    --card-color: #fff;
    
    /* Status colors */
    --success-color: #28a745;
    --success-color-rgb: 40, 167, 69;
    --danger-color: #dc3545;
    --danger-color-rgb: 220, 53, 69;
    --warning-color: #ffc107;
    --warning-color-rgb: 255, 193, 7;
    --info-color: #17a2b8;
    --info-color-rgb: 23, 162, 184;
    --shadow-color: rgba(0, 0, 0, 0.08);
    
    /* Animation for smooth transitions */
    --theme-transition: background-color 0.5s ease, color 0.5s ease, border-color 0.5s ease, box-shadow 0.5s ease;
}

body {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--background-color);
    height: 100vh;
    overflow: hidden;
    transition: var(--theme-transition);
}

button {
    cursor: pointer;
    border: none;
    background: none;
}

/* App container */
.app-container {
    display: flex;
    height: 100vh;
    width: 100%;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    margin-bottom: 0.5rem;
    font-weight: 600;
    line-height: 1.2;
}

p {
    margin-bottom: 1rem;
}

a {
    color: var(--primary-color);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Buttons */
.btn {
    display: inline-block;
    font-weight: 500;
    text-align: center;
    padding: 0.5rem 1rem;
    border-radius: 0.25rem;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    border-radius: 4px;
    padding: 0.75rem 1.5rem;
    font-weight: 500;
    transition: background-color 0.2s;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    text-decoration: none;
}

.btn-outline {
    background-color: transparent;
    border: 1px solid var(--border-color);
}

.btn-outline:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1.1rem;
}

.btn-auth {
    width: 100%;
    margin-top: 1.5rem;
    font-size: 1rem;
    padding: 0.75rem;
}

/* Sidebar styles */
.sidebar {
    width: 300px;
    background-color: #2c3e50;
    color: white;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.sidebar-header {
    padding: 16px;
    border-bottom: 1px solid #34495e;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sidebar-header h2 {
    font-size: 1.2rem;
    margin: 0;
}

.new-chat-btn {
    background-color: #3498db;
    color: white;
    padding: 8px 16px;
    border-radius: 4px;
    font-weight: 500;
    transition: background-color 0.2s;
}

.new-chat-btn:hover {
    background-color: #2980b9;
}

.conversations-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.conversation-item {
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.conversation-item:hover {
    background-color: #34495e;
}

.conversation-item.active {
    background-color: #34495e;
}

/* Chat container styles */
.chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background-color: white;
    border-bottom: 1px solid #e1e1e1;
}

.chat-header h3 {
    font-size: 1.1rem;
    font-weight: 500;
    margin: 0;
}

.chat-header-actions {
    display: flex;
    gap: 8px;
}

.icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.icon-btn:hover {
    background-color: #f0f0f0;
}

.messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Welcome container */
.welcome-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    max-width: 600px;
    margin: auto;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.welcome-suggestions {
    background-color: #1a2e44;
    color: white;
    padding: 1.5rem;
}

.welcome-suggestions h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.suggestion-btn {
    width: 100%;
    padding: 0.8rem;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 1rem;
    cursor: pointer;
    transition: background-color 0.2s;
}

.suggestion-btn:hover {
    background-color: #2980b9;
}

.recent-queries {
    margin-top: 1.5rem;
}

.query-item {
    padding: 0.6rem 0;
    cursor: pointer;
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.9);
    transition: color 0.2s;
}

.query-item:hover {
    color: #3498db;
}

.welcome-message {
    flex: 1;
    padding: 1.5rem;
    background-color: white;
    text-align: left;
}

.welcome-message h3 {
    font-size: 1.4rem;
    margin-bottom: 1rem;
    color: #2c3e50;
}

.welcome-message p {
    font-size: 1rem;
    color: #7f8c8d;
}

.message {
    display: flex;
    flex-direction: column;
    max-width: 80%;
}

.message.user {
    align-self: flex-end;
}

.message.assistant {
    align-self: flex-start;
}

.message-content {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 0.95rem;
}

.user .message-content {
    background-color: #3498db;
    color: white;
    border-top-right-radius: 2px;
}

.assistant .message-content {
    background-color: #ecf0f1;
    border-top-left-radius: 2px;
}

.message-timestamp {
    font-size: 0.7rem;
    margin-top: 4px;
    color: #95a5a6;
    align-self: flex-end;
}

.user .message-timestamp {
    align-self: flex-end;
}

.assistant .message-timestamp {
    align-self: flex-start;
}

/* Follow-up suggestions */
.suggestions-container {
    margin-top: 12px;
    width: 100%;
}

.suggestions-header {
    font-size: 0.8rem;
    color: #7f8c8d;
    margin-bottom: 8px;
}

.suggestions-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.suggestion-btn {
    padding: 6px 12px;
    background-color: #f0f4f8;
    color: #3498db;
    border: 1px solid #e0e5e9;
    border-radius: 16px;
    font-size: 0.85rem;
    transition: all 0.2s;
    cursor: pointer;
    text-align: left;
}

.suggestion-btn:hover {
    background-color: #e4e9ed;
    color: #2573a7;
}

.chat-input-container {
    padding: 16px;
    background-color: white;
    border-top: 1px solid #e1e1e1;
}

.chat-input-wrapper {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    background-color: #f5f5f5;
    border-radius: 8px;
    padding: 8px 16px;
}

#message-input {
    flex: 1;
    border: none;
    background-color: transparent;
    resize: none;
    padding: 8px 0;
    max-height: 120px;
    font-family: inherit;
    font-size: 0.95rem;
    outline: none;
}

.send-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #3498db;
    transition: color 0.2s;
}

.send-btn:hover {
    color: #2980b9;
}

/* Modal styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    overflow: auto;
}

.modal-content {
    background-color: white;
    margin: 10% auto;
    width: 90%;
    max-width: 500px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid #e1e1e1;
}

.modal-header h3 {
    font-size: 1.2rem;
    font-weight: 500;
    margin: 0;
}

.close-btn {
    font-size: 1.5rem;
    font-weight: bold;
    color: #7f8c8d;
}

.modal-body {
    padding: 16px;
}

.settings-section {
    margin-bottom: 24px;
}

.settings-section h4 {
    font-size: 1rem;
    margin-bottom: 16px;
    color: #2c3e50;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.9rem;
    color: #7f8c8d;
}

.form-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid #e1e1e1;
    border-radius: 4px;
    font-size: 0.9rem;
}

.primary-btn {
    background-color: #3498db;
    color: white;
    padding: 10px 16px;
    border-radius: 4px;
    font-weight: 500;
    transition: background-color 0.2s;
}

.primary-btn:hover {
    background-color: #2980b9;
}

/* Loading spinner */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

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

/* Authentication Pages Styles */
.auth-body {
    background-color: var(--background-color);
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
    overflow: auto;
}

.auth-container {
    width: 100%;
    max-width: 450px;
    padding: 1rem;
}

.auth-card {
    background-color: var(--card-color);
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    padding: 2.5rem;
    text-align: center;
}

.auth-avatar {
    width: 80px;
    height: 80px;
    background-color: #e6eeff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
}

.auth-title {
    font-size: 1.6rem;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.auth-subtitle {
    color: var(--text-light);
    margin-bottom: 2rem;
}

.auth-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 2rem;
}

.auth-tab {
    flex: 1;
    padding: 0.75rem;
    font-weight: 500;
    color: var(--text-light);
    background-color: transparent;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.auth-tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.auth-form {
    text-align: left;
}

.input-with-icon {
    position: relative;
}

.input-with-icon svg {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
}

.input-with-icon input {
    padding-left: 35px;
}

.forgot-password {
    text-align: right;
    margin-top: 0.5rem;
    font-size: 0.85rem;
}

/* Dashboard Styles */
.dashboard-container {
    width: 100%;
    min-height: 100vh;
    background-color: var(--background-color);
}

.dashboard-header {
    background-color: var(--card-color);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.brand {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-color);
}

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

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-color);
    text-decoration: none;
    padding: 0.5rem;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.nav-link:hover {
    background-color: rgba(0, 0, 0, 0.05);
    text-decoration: none;
}

.nav-link.active {
    color: var(--primary-color);
    font-weight: 500;
}

.dashboard-content {
    padding: 2rem;
    max-width: 1280px;
    margin: 0 auto;
}

.dashboard-title {
    margin-bottom: 1.5rem;
    font-size: 1.75rem;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.dashboard-card {
    background-color: var(--card-color);
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.dashboard-card-title {
    color: var(--text-light);
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 0.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dashboard-card-value {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.dashboard-card-description {
    color: var(--text-light);
    font-size: 0.85rem;
}

.tasks-card, .events-card {
    grid-column: span 3;
}

.empty-state {
    padding: 2rem;
    text-align: center;
    color: var(--text-light);
}

/* Task Management Styles */
.task-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.2s;
}

.task-item:hover {
    background-color: rgba(0, 0, 0, 0.02);
}

.task-checkbox {
    margin-right: 16px;
}

.task-checkbox input {
    display: none;
}

.task-checkbox label {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border: 2px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.task-checkbox input:checked + label {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.task-checkbox input:checked + label:after {
    content: "✓";
    color: white;
    font-size: 14px;
}

.task-content {
    flex: 1;
}

.task-title {
    font-weight: 500;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.task-meta {
    display: flex;
    gap: 16px;
    color: var(--text-light);
    font-size: 0.8rem;
}

.task-badge {
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 500;
}

.task-badge.high {
    background-color: rgba(231, 76, 60, 0.1);
    color: #e74c3c;
}

.task-badge.medium {
    background-color: rgba(243, 156, 18, 0.1);
    color: #f39c12;
}

.task-badge.low {
    background-color: rgba(46, 204, 113, 0.1);
    color: #2ecc71;
}

.task-actions {
    display: flex;
    gap: 8px;
    opacity: 0;
    transition: opacity 0.2s;
}

.task-item:hover .task-actions {
    opacity: 1;
}

.task-edit-btn, .task-delete-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-light);
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s;
}

.task-edit-btn:hover {
    color: var(--primary-color);
    background-color: rgba(65, 105, 225, 0.1);
}

.task-delete-btn:hover {
    color: #e74c3c;
    background-color: rgba(231, 76, 60, 0.1);
}

.recommendation-card {
    background-color: var(--card-color);
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.recommendation-tag {
    display: inline-block;
    background-color: rgba(65, 105, 225, 0.1);
    color: var(--primary-color);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

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

.recommendation-close {
    color: var(--text-light);
    cursor: pointer;
}

.recommendation-message {
    margin-bottom: 1rem;
}

.recommendation-action {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background-color: var(--primary-color);
    color: white;
    border-radius: 4px;
    font-size: 0.875rem;
}

.form-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.form-col {
    flex: 1;
}

.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.switch input { 
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--primary-color);
}

input:focus + .slider {
    box-shadow: 0 0 1px var(--primary-color);
}

input:checked + .slider:before {
    transform: translateX(26px);
}

/* Mobile Navigation */
.mobile-menu-container {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: var(--card-color);
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
}

.mobile-nav {
    display: flex;
    justify-content: space-around;
    padding: 0.75rem 0;
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--text-light);
    text-decoration: none;
    font-size: 0.7rem;
    padding: 0.5rem;
}

.mobile-nav-item svg {
    margin-bottom: 0.25rem;
}

.mobile-nav-item.active {
    color: var(--primary-color);
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        height: auto;
        max-height: 50vh;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .dashboard-card, 
    .tasks-card, 
    .events-card {
        grid-column: span 1;
    }
    
    .nav-links {
        display: none;
    }
    
    .mobile-menu-btn {
        display: block;
    }
    
    .form-row {
        flex-direction: column;
    }
    
    .dashboard-content {
        padding: 1rem;
        padding-bottom: 5rem; /* Add space for mobile navigation */
    }
    
    .mobile-menu-container {
        display: block;
    }
    
    .auth-card {
        padding: 1.5rem;
    }
    
    /* Chat interface mobile optimizations */
    .chat-container {
        padding-bottom: 4rem;
    }
    
    .chat-header {
        padding: 0.75rem;
    }
    
    .message {
        max-width: 90%;
    }
    
    .chat-input-container {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background-color: white;
        padding: 0.75rem;
        box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    }
    
    /* Dashboard mobile optimizations */
    .dashboard-title {
        font-size: 1.5rem;
    }
    
    .dashboard-card-value {
        font-size: 1.5rem;
    }
    
    /* Make table responsive */
    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
    
    /* Form fields */
    input, select, textarea {
        font-size: 16px; /* Prevents iOS zoom on focus */
    }
}

@media (max-width: 480px) {
    .auth-container {
        padding: 0.5rem;
    }
    
    .auth-card {
        padding: 1.25rem;
    }
    
    .auth-title {
        font-size: 1.4rem;
    }
    
    .dashboard-card {
        padding: 1rem;
    }
    
    .btn-primary, .btn {
        padding: 0.5rem 1rem;
    }
}