/* CSS Variables for Theming */
:root {
    --bg-primary: #1a1a1a;
    --bg-secondary: #2d2d2d;
    --bg-tertiary: #3a3a3a;
    --text-primary: #ffffff;
    --text-secondary: #b0b0b0;
    --accent-primary: #012753;
    --accent-hover: #0b1e35;
    --user-message-bg: #052449;
    --ai-message-bg: #2d2d2d;
    --border-color: #404040;
    --shadow: rgba(0, 0, 0, 0.3);
    --transition: all 0.3s ease;
}

[data-theme="light"] {
    --bg-primary: #ffffff;
    --bg-secondary: #f5f5f5;
    --bg-tertiary: #e8e8e8;
    --text-primary: #1a1a1a;
    --text-secondary: #666666;
    --accent-primary: #021327;
    --accent-hover: #021d3b;
    --user-message-bg: #001834;
    --ai-message-bg: #f0f0f0;
    --border-color: #d0d0d0;
    --shadow: rgba(0, 0, 0, 0.1);
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    transition: var(--transition);
    height: 100vh;
    overflow: hidden;
}

/* Navbar */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    height: 60px;
    animation: slideDown 0.5s ease-out;
}

.navbar-left, .navbar-center, .navbar-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.app-logo {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    animation: bounce 1s ease-out;
}

.app-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #ffffff;
    cursor: pointer;
    transition: all 0.3s ease;
}

.app-title:hover {
    transform: scale(1.05);
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
}

.mode-selector {
    padding: 0.5rem 1rem;
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.mode-selector:hover {
    border-color: var(--accent-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow);
}

.mode-selector:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(74, 158, 255, 0.2);
}

.theme-toggle {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.theme-toggle:hover {
    background-color: var(--bg-tertiary);
    transform: rotate(180deg) scale(1.2);
}

.theme-toggle:active {
    transform: rotate(180deg) scale(0.9);
}

.dashboard-link {
    color: var(--text-primary);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.dashboard-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, var(--accent-primary), transparent);
    transition: left 0.5s ease;
}

.dashboard-link:hover::before {
    left: 100%;
}

.dashboard-link:hover {
    background-color: var(--bg-tertiary);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px var(--shadow);
}

/* Main Container */
.main-container {
    display: flex;
    height: calc(100vh - 60px);
}

/* Sidebar */
.sidebar {
    width: 280px;
    background-color: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    animation: slideInLeft 0.5s ease-out;
}

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

.sidebar-header {
    padding: 1.5rem 1rem;
    border-bottom: 1px solid var(--border-color);
    animation: fadeIn 0.6s ease-out 0.2s both;
}

.sidebar-header h2 {
    font-size: 1.2rem;
    font-weight: 600;
    transition: all 0.3s ease;
    color: var(--text-primary);
}

.sidebar-header:hover h2 {
    color: #6bb3ff;
    transform: translateX(5px);
}

.sidebar-actions {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    animation: fadeIn 0.6s ease-out 0.3s both;
}

.documents-list {
    flex: 1;
    padding: 0.5rem;
    overflow-y: auto;
    animation: fadeIn 0.6s ease-out 0.4s both;
}

.document-item {
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    background-color: var(--bg-tertiary);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    word-break: break-word;
    position: relative;
    overflow: hidden;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    color: white;
}

.document-name {
    flex: 1;
    cursor: pointer;
    transition: color 0.3s ease;
}

.document-item:hover {
    background-color: rgba(74, 158, 255, 0.1);
    color: #6bb3ff;
    transform: translateX(8px);
    box-shadow: 0 4px 12px rgba(74, 158, 255, 0.3);
}

.document-item:hover .document-name {
    color: #6bb3ff;
}

.document-delete-btn {
    background: rgba(244, 67, 54, 0.1);
    border: 1px solid rgba(244, 67, 54, 0.3);
    color: #f44336;
    font-size: 1.3rem;
    font-weight: bold;
    line-height: 1;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: all 0.3s ease;
    min-width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.document-item:hover .document-delete-btn {
    background: rgba(244, 67, 54, 0.2);
    border-color: #f44336;
}

.document-delete-btn:hover {
    background-color: #f44336;
    color: white;
    transform: scale(1.15);
    border-color: #f44336;
}

.document-delete-btn:active {
    transform: scale(0.95);
}

.document-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 3px;
    background: var(--accent-primary);
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

.document-item:hover::before {
    transform: scaleY(1);
}

.document-item:hover {
    background-color: var(--accent-primary);
    color: white;
    transform: translateX(8px);
    box-shadow: 0 4px 12px rgba(74, 158, 255, 0.3);
}

.document-item:active {
    transform: translateX(4px) scale(0.98);
}

.document-item.selected {
    background-color: rgba(74, 158, 255, 0.15);
    color: #6bb3ff;
    transform: translateX(8px);
    box-shadow: 0 4px 12px rgba(74, 158, 255, 0.3);
}

.document-item.selected .document-name {
    color: #6bb3ff;
}

.document-item.selected::before {
    transform: scaleY(1);
}

.document-item.loading {
    opacity: 0.6;
    pointer-events: none;
}

.document-item.loading .document-name {
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Chat Container */
.chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: var(--bg-primary);
    animation: fadeIn 0.5s ease-out;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    scroll-behavior: smooth;
}

.welcome-message {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--text-secondary);
    position: relative;
}

.welcome-message h2 {
    margin-bottom: 1rem;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    animation: titleEntrance 1s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    opacity: 0;
}

@keyframes titleEntrance {
    0% {
        opacity: 0;
        transform: translateY(-30px) scale(0.8);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.welcome-message p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    animation: subtitleEntrance 0.8s ease-out 0.3s forwards;
    opacity: 0;
}

@keyframes subtitleEntrance {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Wave Emoji Animation - Single wave */
.wave-emoji {
    display: inline-block;
    animation: waveHand 0.6s ease-in-out 0.8s 1 forwards;
    transform-origin: 70% 70%;
}

@keyframes waveHand {
    0% { transform: rotate(0deg); }
    10% { transform: rotate(14deg); }
    20% { transform: rotate(-8deg); }
    30% { transform: rotate(14deg); }
    40% { transform: rotate(-4deg); }
    50% { transform: rotate(10deg); }
    60% { transform: rotate(0deg); }
    100% { transform: rotate(0deg); }
}

/* Message Bubbles */
.message {
    display: flex;
    gap: 0.75rem;
    max-width: 80%;
    animation: messageSlideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    transition: all 0.3s ease;
}

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

.message:hover {
    transform: translateX(4px);
}

.message.user:hover {
    transform: translateX(-4px);
}

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

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

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

.message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.message:hover .message-avatar {
    transform: scale(1.15) rotate(5deg);
    box-shadow: 0 4px 12px var(--shadow);
}

.message.user .message-avatar {
    background-color: var(--accent-primary);
}

.message.ai .message-avatar {
    background-color: var(--bg-tertiary);
    animation: aiPulse 2s ease-in-out infinite;
}

@keyframes aiPulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(74, 158, 255, 0.4);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(74, 158, 255, 0);
    }
}

.message-content {
    flex: 1;
}

.message-bubble {
    padding: 1rem;
    border-radius: 12px;
    word-wrap: break-word;
    position: relative;
    transition: all 0.3s ease;
}

.message:hover .message-bubble {
    box-shadow: 0 8px 24px var(--shadow);
    transform: translateY(-2px);
}

.message.user .message-bubble {
    background-color: var(--user-message-bg);
    color: white;
}

.message.ai .message-bubble {
    background-color: var(--ai-message-bg);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.message.ai:hover .message-bubble {
    border-color: var(--accent-primary);
}

.message-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.copy-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.85rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.copy-btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(74, 158, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.4s, height 0.4s;
}

.copy-btn:active::after {
    width: 100px;
    height: 100px;
}

.copy-btn:hover {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    transform: scale(1.1);
}

.copy-btn:active {
    transform: scale(0.95);
}

.download-btn {
    background: linear-gradient(135deg, #4caf50, #45a049);
    color: white;
    padding: 0.4rem 0.8rem;
    margin-left: 0.5rem;
}

.download-btn:hover {
    background: linear-gradient(135deg, #45a049, #3d8b40);
    transform: scale(1.05);
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    gap: 0.5rem;
    padding: 1rem 2rem;
    align-items: center;
    animation: fadeIn 0.3s ease;
}

.typing-indicator span {
    width: 10px;
    height: 10px;
    background: linear-gradient(135deg, var(--accent-primary), #3a7bd5);
    border-radius: 50%;
    animation: typingBounce 1.4s infinite ease-in-out;
    box-shadow: 0 0 10px rgba(74, 158, 255, 0.5);
}

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

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

@keyframes typingBounce {
    0%, 60%, 100% {
        transform: translateY(0) scale(1);
        opacity: 0.7;
    }
    30% {
        transform: translateY(-15px) scale(1.2);
        opacity: 1;
        box-shadow: 0 4px 15px rgba(74, 158, 255, 0.8);
    }
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.7;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

/* Input Area */
.input-area {
    display: flex;
    gap: 1rem;
    padding: 1.5rem 2rem;
    background-color: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    animation: slideUp 0.5s ease-out;
}

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

.message-input {
    flex: 1;
    padding: 0.75rem 1rem;
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    font-size: 1rem;
    font-family: inherit;
    resize: none;
    max-height: 150px;
    transition: all 0.3s ease;
}

.message-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(74, 158, 255, 0.2);
    transform: translateY(-2px);
}

.message-input:hover {
    border-color: var(--accent-primary);
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:active::before {
    width: 300px;
    height: 300px;
}

.btn-primary {
    background-color: var(--accent-primary);
    color: white;
}

.btn-primary:hover {
    background-color: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(74, 158, 255, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background-color: var(--bg-primary);
    border-color: var(--accent-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow);
}

.btn-send {
    background-color: var(--accent-primary);
    color: white;
    padding: 0.75rem 2rem;
}

.btn-send:hover {
    background-color: var(--accent-hover);
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 20px rgba(74, 158, 255, 0.4);
}

.btn-send:active {
    transform: translateY(0) scale(0.98);
}

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

/* Notifications */
.notification-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.notification {
    padding: 1rem 1.5rem;
    border-radius: 8px;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 12px var(--shadow);
    animation: notificationSlideIn 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    max-width: 350px;
    transition: all 0.3s ease;
}

@keyframes notificationSlideIn {
    from {
        transform: translateX(450px) rotate(10deg);
        opacity: 0;
    }
    to {
        transform: translateX(0) rotate(0deg);
        opacity: 1;
    }
}

.notification:hover {
    transform: translateX(-5px) scale(1.02);
    box-shadow: 0 8px 24px var(--shadow);
}

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

.notification.success {
    border-left: 4px solid #4caf50;
}

.notification.error {
    border-left: 4px solid #f44336;
}

.notification.warning {
    border-left: 4px solid #ff9800;
}

.notification.info {
    border-left: 4px solid var(--accent-primary);
}

/* Dashboard */
.dashboard-container {
    padding: 1.5rem 2rem;
    max-width: 1400px;
    margin: 0 auto;
    height: calc(100vh - 60px);
    overflow-y: auto;
    overflow-x: hidden;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding: 1.5rem 2rem;
    background: linear-gradient(135deg, var(--accent-primary) 0%, #3a7bd5 100%);
    border-radius: 16px;
    color: white;
    animation: slideDown 0.6s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dashboard-title h2 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.dashboard-title p {
    font-size: 1rem;
    opacity: 0.9;
}

.dashboard-summary {
    display: flex;
    gap: 2rem;
    animation: fadeIn 0.8s ease-out 0.2s both;
}

.summary-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem 2rem;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    backdrop-filter: blur(10px);
}

.summary-label {
    font-size: 0.9rem;
    opacity: 0.9;
    margin-bottom: 0.5rem;
}

.summary-value {
    font-size: 2.5rem;
    font-weight: 700;
    animation: countUp 1s ease-out;
}

@keyframes countUp {
    from {
        opacity: 0;
        transform: scale(0.5);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.stats-grid {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 1rem;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

.stats-grid::-webkit-scrollbar {
    height: 10px;
}

.stats-grid::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
    border-radius: 10px;
}

.stats-grid::-webkit-scrollbar-thumb {
    background: var(--accent-primary);
    border-radius: 10px;
}

.stats-grid::-webkit-scrollbar-thumb:hover {
    background: var(--accent-hover);
}

.stat-card {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    animation: fadeInUp 0.6s ease-out both;
    min-width: 280px;
    flex-shrink: 0;
}

.stat-card:nth-child(1) { animation-delay: 0.1s; }
.stat-card:nth-child(2) { animation-delay: 0.2s; }
.stat-card:nth-child(3) { animation-delay: 0.3s; }
.stat-card:nth-child(4) { animation-delay: 0.4s; }
.stat-card:nth-child(5) { animation-delay: 0.5s; }

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

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--accent-primary), #3a7bd5);
    transition: height 0.3s ease;
}

.stat-card:hover::before {
    height: 6px;
}

.stat-card-primary::before {
    background: linear-gradient(90deg, #4a9eff, #3a7bd5);
}

.stat-card-success::before {
    background: linear-gradient(90deg, #4caf50, #45a049);
}

.stat-card-info::before {
    background: linear-gradient(90deg, #9c27b0, #7b1fa2);
}

.stat-card-warning::before {
    background: linear-gradient(90deg, #ff9800, #f57c00);
}

.stat-card-danger::before {
    background: linear-gradient(90deg, #f44336, #d32f2f);
}

.stat-card:hover {
    transform: translateY(-12px) scale(1.02);
    box-shadow: 0 20px 40px var(--shadow);
    border-color: var(--accent-primary);
}

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

.stat-icon {
    font-size: 3rem;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
    animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.stat-card:hover .stat-icon {
    animation: spin 0.6s ease-in-out;
}

@keyframes spin {
    0% {
        transform: rotate(0deg) scale(1);
    }
    50% {
        transform: rotate(180deg) scale(1.2);
    }
    100% {
        transform: rotate(360deg) scale(1);
    }
}

.stat-trend {
    font-size: 0.9rem;
    padding: 0.25rem 0.75rem;
    background: rgba(76, 175, 80, 0.15);
    color: #4caf50;
    border-radius: 20px;
    font-weight: 600;
    animation: pulse 2s ease-in-out infinite;
}

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

.stat-value {
    font-size: 3.5rem;
    font-weight: 700;
    color: white;
    margin-bottom: 0.5rem;
    line-height: 1;
    transition: all 0.3s ease;
}

.stat-card:hover .stat-value {
    transform: scale(1.1);
    color: #6bb3ff;
    text-shadow: 0 0 20px #6bb3ff;
}

.stat-label {
    color: var(--text-primary);
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    transition: color 0.3s ease;
}

.stat-card:hover .stat-label {
    color: #6bb3ff;
}

.stat-footer {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

.dashboard-footer {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 3rem;
    animation: fadeIn 1s ease-out 0.8s both;
}

.progress-section {
    margin-bottom: 2rem;
}

.progress-section h3 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    text-align: center;
}

.charts-row {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    justify-content: center;
}

.chart-container {
    background: var(--bg-primary);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    flex: 1;
    min-width: 400px;
    max-width: 550px;
    height: 500px;
}

.chart-container h4 {
    text-align: center;
    color: var(--text-primary);
    margin-bottom: 1rem;
    font-size: 1.1rem;
    font-weight: 600;
}

.chart-container canvas {
    max-height: 380px;
}

.progress-bars {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.progress-item {
    background: var(--bg-primary);
    padding: 1rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    font-size: 1rem;
    color: var(--text-primary);
    font-weight: 500;
}

.progress-count {
    font-weight: 700;
    color: #6bb3ff;
    font-size: 1.1rem;
}

.progress-bar {
    width: 100%;
    height: 24px;
    background: var(--bg-secondary);
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4a9eff, #6bb3ff);
    border-radius: 12px;
    transition: width 1s ease-out;
    position: relative;
    box-shadow: 0 2px 8px rgba(74, 158, 255, 0.4);
    width: 0;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

.footer-message {
    text-align: center;
}

.footer-message h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: #6bb3ff;
    animation: glow 2s ease-in-out infinite;
}

@keyframes glow {
    0%, 100% {
        text-shadow: 0 0 10px #6bb3ff;
    }
    50% {
        text-shadow: 0 0 20px #6bb3ff, 0 0 30px #6bb3ff;
    }
}

.footer-message p {
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

@media (max-width: 768px) {
    .dashboard-container {
        padding: 1.5rem;
    }
    
    .dashboard-header {
        flex-direction: column;
        text-align: center;
        gap: 1.5rem;
    }
    
    .dashboard-title h2 {
        font-size: 2rem;
    }
    
    .stats-grid {
        gap: 1.5rem;
    }
    
    .stat-card {
        min-width: 250px;
    }
    
    .stat-value {
        font-size: 2.5rem;
    }
}

/* Code Blocks */
.message-bubble pre {
    background-color: #1e1e1e;
    padding: 1rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 0.5rem 0;
}

.message-bubble code {
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
}

.message-bubble p code {
    background-color: var(--bg-tertiary);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
}

/* Timetable Styling */
.message-bubble table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: 1rem 0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px var(--shadow);
    animation: tableSlideIn 0.5s ease-out;
}

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

.message-bubble table thead {
    background: linear-gradient(135deg, var(--accent-primary) 0%, #3a7bd5 100%);
    color: white;
}

.message-bubble table th {
    padding: 1rem;
    text-align: center;
    font-weight: 600;
    font-size: 0.95rem;
    border: none;
    position: relative;
}

.message-bubble table th:first-child {
    border-top-left-radius: 12px;
}

.message-bubble table th:last-child {
    border-top-right-radius: 12px;
}

.message-bubble table tbody tr {
    transition: all 0.3s ease;
}

.message-bubble table tbody tr:hover {
    background-color: var(--bg-tertiary);
    transform: scale(1.01);
    box-shadow: 0 2px 8px var(--shadow);
}

.message-bubble table tbody tr:nth-child(even) {
    background-color: var(--bg-secondary);
}

.message-bubble table tbody tr:nth-child(odd) {
    background-color: var(--bg-primary);
}

.message-bubble table td {
    padding: 0.75rem;
    text-align: center;
    border: 1px solid var(--border-color);
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.message-bubble table td:first-child {
    font-weight: 600;
    background: linear-gradient(135deg, rgba(74, 158, 255, 0.1) 0%, rgba(58, 123, 213, 0.1) 100%);
    color: var(--accent-primary);
    border-left: 3px solid var(--accent-primary);
}

.message-bubble table td:hover {
    background-color: rgba(74, 158, 255, 0.1);
    transform: scale(1.05);
    cursor: pointer;
}

.message-bubble table tbody tr:last-child td:first-child {
    border-bottom-left-radius: 12px;
}

.message-bubble table tbody tr:last-child td:last-child {
    border-bottom-right-radius: 12px;
}

/* Responsive table */
@media (max-width: 768px) {
    .message-bubble table {
        font-size: 0.8rem;
    }
    
    .message-bubble table th,
    .message-bubble table td {
        padding: 0.5rem 0.25rem;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .sidebar {
        position: absolute;
        left: -280px;
        height: 100%;
        z-index: 100;
        transition: left 0.3s ease;
    }
    
    .sidebar.open {
        left: 0;
    }
    
    .message {
        max-width: 95%;
    }
    
    .navbar {
        padding: 1rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--border-color);
}

/* Mode Instructions */
.mode-instructions {
    padding: 1rem 2rem;
    background: linear-gradient(135deg, var(--accent-primary) 0%, #3a7bd5 100%);
    border-bottom: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

.mode-instructions::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: shimmer 3s linear infinite;
}

@keyframes shimmer {
    0% {
        transform: translate(-50%, -50%) rotate(0deg);
    }
    100% {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

.mode-info {
    color: white;
    animation: modeSlideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 1;
}

@keyframes modeSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.mode-info h3 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
    animation: fadeIn 0.5s ease 0.1s both;
}

.mode-info p {
    font-size: 0.95rem;
    opacity: 0.95;
    line-height: 1.5;
    animation: fadeIn 0.5s ease 0.2s both;
}
