/* css/pages.css */

/* --- Home / Dashboard --- */
.hero-section {
    text-align: center;
    padding: 4rem 1rem;
    margin-bottom: 3rem;
    background: linear-gradient(135deg, rgba(30, 58, 138, 0.05), rgba(225, 29, 72, 0.05));
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--border);
}

.hero-section h1 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
}

.hero-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.stat-card {
    text-align: center;
    padding: 1.5rem;
}

.stat-card i {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--primary);
}

.stat-card .number {
    font-size: 2rem;
    font-weight: 800;
    font-family: var(--font-heading);
    margin-bottom: 0.5rem;
}

/* Level Grid */
.level-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

.level-card {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.level-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.level-title {
    font-size: 1.5rem;
    font-weight: 700;
}

/* --- Alphabet & Numbers --- */
.grid-auto-fit {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1.5rem;
}

.item-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.5rem;
    padding: 2rem 1rem;
}

.item-main {
    font-size: 4rem;
    font-weight: 800;
    font-family: var(--font-heading);
    color: var(--primary);
    line-height: 1;
}

.item-sub {
    font-size: 1rem;
    color: var(--text-muted);
}

/* --- Vocabulary --- */
.vocab-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 2rem;
}

.vocab-card-container {
    height: 300px;
    cursor: pointer;
}

/* --- Quizzes --- */
.quiz-container {
    max-width: 800px;
    margin: 0 auto;
}

.quiz-question {
    font-size: 1.5rem;
    margin-bottom: 2rem;
    text-align: center;
}

.quiz-options {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.quiz-option {
    padding: 1rem 1.5rem;
    border: 2px solid var(--border);
    border-radius: var(--border-radius-md);
    background: var(--bg-card);
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1.1rem;
    text-align: left;
}

.quiz-option:hover {
    border-color: var(--primary);
    background: rgba(30, 58, 138, 0.05);
}

.quiz-option.correct {
    background: rgba(16, 185, 129, 0.1);
    border-color: var(--success);
    color: var(--success);
}

.quiz-option.wrong {
    background: rgba(239, 68, 68, 0.1);
    border-color: var(--error);
    color: var(--error);
}

/* 🤖 AI Genius Chat Styles */
.quick-chip:hover {
    background: rgba(6, 182, 212, 0.15) !important;
    border-color: #06b6d4 !important;
    color: #fff !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(6, 182, 212, 0.25);
}

.chat-bubble {
    animation: bubbleFadeIn 0.25s ease-out;
}

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

#ai-messages-area::-webkit-scrollbar {
    width: 6px;
}
#ai-messages-area::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
}
#ai-messages-area::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}
#ai-messages-area::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

#ai-user-input:focus {
    outline: none;
    border-color: #06b6d4 !important;
    box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.2) !important;
}

/* 🗂️ AI Chat Layout with Conversation History Sidebar */
.ai-layout {
    display: flex;
    gap: 1rem;
    height: calc(100vh - 220px);
    min-height: 500px;
}

.ai-conversations-sidebar {
    width: 280px;
    min-width: 280px;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    backdrop-filter: blur(16px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.ai-sidebar-header {
    padding: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
}

.ai-new-chat-btn {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    border: 1px dashed rgba(6, 182, 212, 0.4);
    background: rgba(6, 182, 212, 0.08);
    color: #67e8f9;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.25s ease;
}

.ai-new-chat-btn:hover {
    background: rgba(6, 182, 212, 0.18);
    border-color: #06b6d4;
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(6, 182, 212, 0.25);
}

.ai-conv-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.ai-conv-list::-webkit-scrollbar {
    width: 4px;
}
.ai-conv-list::-webkit-scrollbar-track {
    background: transparent;
}
.ai-conv-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.ai-conv-item {
    padding: 0.7rem 0.85rem;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    transition: all 0.2s ease;
    background: transparent;
    border: 1px solid transparent;
    position: relative;
}

.ai-conv-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.08);
}

.ai-conv-item.active {
    background: rgba(59, 130, 246, 0.12);
    border-color: rgba(59, 130, 246, 0.3);
    box-shadow: 0 0 12px rgba(59, 130, 246, 0.1);
}

.ai-conv-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(59, 130, 246, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #60a5fa;
    font-size: 0.8rem;
    flex-shrink: 0;
}

.ai-conv-item.active .ai-conv-icon {
    background: rgba(6, 182, 212, 0.2);
    color: #22d3ee;
}

.ai-conv-info {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.ai-conv-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: #e2e8f0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 0;
    line-height: 1.3;
}

.ai-conv-time {
    font-size: 0.7rem;
    color: #64748b;
    margin: 0;
    margin-top: 2px;
}

.ai-conv-delete {
    opacity: 0;
    background: none;
    border: none;
    color: #64748b;
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    font-size: 0.75rem;
    transition: all 0.15s;
    flex-shrink: 0;
}

.ai-conv-item:hover .ai-conv-delete {
    opacity: 1;
}

.ai-conv-delete:hover {
    color: #f87171;
    background: rgba(248, 113, 113, 0.12);
}

.ai-main-chat {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.ai-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    text-align: center;
    color: #64748b;
    gap: 0.5rem;
}

.ai-empty-state i {
    font-size: 2rem;
    color: #334155;
    margin-bottom: 0.5rem;
}

.ai-sidebar-label {
    font-size: 0.7rem;
    font-weight: 700;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.6rem 0.85rem 0.3rem;
}

/* Mobile toggle button for sidebar */
.ai-sidebar-toggle {
    display: none;
    background: rgba(30, 41, 59, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #94a3b8;
    padding: 0.5rem 0.75rem;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.85rem;
    align-items: center;
    gap: 0.4rem;
}

.ai-sidebar-toggle:hover {
    color: #e2e8f0;
    border-color: rgba(255, 255, 255, 0.25);
}

/* Responsive: hide sidebar on mobile */
@media (max-width: 768px) {
    .ai-layout {
        flex-direction: column;
        height: auto;
    }
    .ai-conversations-sidebar {
        width: 100%;
        min-width: 100%;
        max-height: 200px;
        border-radius: 12px;
    }
    .ai-conversations-sidebar.hidden-mobile {
        display: none;
    }
    .ai-sidebar-toggle {
        display: flex;
    }
}

