/* ================================================
   EduAI Dashboard - Educational AI Tools Demo
   ================================================ */

:root {
    /* Dark Theme Colors */
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --accent-primary: #8b5cf6;
    --accent-secondary: #a78bfa;
    --accent-gradient: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;
    --border-color: #334155;
    --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);

    /* Light Theme (Student) */
    --student-bg: #f8fafc;
    --student-bg-card: #ffffff;
    --student-text: #1e293b;
    --student-text-secondary: #64748b;
    --student-accent: #6366f1;
    --student-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', 'Noto Sans JP', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

body.student-theme {
    background: var(--student-bg);
    color: var(--student-text);
}

/* ================================================
   Entry Page Styles
   ================================================ */
.entry-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 50%, #312e81 100%);
    padding: 2rem;
}

.entry-container {
    text-align: center;
    max-width: 800px;
}

.entry-logo {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.entry-title {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #a78bfa, #818cf8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

.entry-subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 3rem;
}

.entry-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.entry-card {
    background: rgba(30, 41, 59, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: 1.5rem;
    padding: 2.5rem;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.entry-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--accent-gradient);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.entry-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(139, 92, 246, 0.2);
}

.entry-card:hover::before {
    opacity: 1;
}

.entry-card-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.entry-card h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.entry-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.entry-card.student-card::before {
    background: linear-gradient(135deg, #10b981, #3b82f6);
}

/* ================================================
   Layout - Sidebar
   ================================================ */
.dashboard-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 280px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    padding: 1.5rem;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1.5rem;
    text-decoration: none;
    color: var(--text-primary);
}

.sidebar-logo-icon {
    font-size: 2rem;
}

.sidebar-logo-text {
    font-size: 1.25rem;
    font-weight: 700;
}

.sidebar-nav {
    list-style: none;
}

.sidebar-nav-item {
    margin-bottom: 0.25rem;
}

.sidebar-nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 0.75rem;
    transition: all 0.2s ease;
    font-size: 0.95rem;
}

.sidebar-nav-link:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.sidebar-nav-link.active {
    background: var(--accent-gradient);
    color: white;
}

.sidebar-nav-link i {
    width: 20px;
    text-align: center;
}

.sidebar-section-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    padding: 1.5rem 1rem 0.5rem;
}

/* ================================================
   Main Content Area
   ================================================ */
.main-content {
    flex: 1;
    margin-left: 280px;
    padding: 2rem;
}

.page-header {
    margin-bottom: 2rem;
}

.page-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.page-description {
    color: var(--text-secondary);
}

/* ================================================
   Cards & Stats
   ================================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    padding: 1.5rem;
    transition: transform 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
}

.stat-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.stat-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-card-icon.purple {
    background: rgba(139, 92, 246, 0.2);
    color: #a78bfa;
}

.stat-card-icon.blue {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
}

.stat-card-icon.green {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
}

.stat-card-icon.orange {
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
}

.stat-card-value {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.stat-card-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.stat-card-trend {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.85rem;
    margin-top: 0.5rem;
}

.stat-card-trend.up {
    color: var(--success);
}

.stat-card-trend.down {
    color: var(--danger);
}

/* ================================================
   Content Cards
   ================================================ */
.content-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.content-card-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.content-card-title {
    font-size: 1.1rem;
    font-weight: 600;
}

.content-card-body {
    padding: 1.5rem;
}

/* ================================================
   Tool Cards (Admin Dashboard)
   ================================================ */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
}

.tool-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    padding: 1.5rem;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.tool-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--accent-gradient);
}

.tool-card:hover {
    transform: translateX(4px);
    box-shadow: var(--card-shadow);
}

.tool-card-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.tool-card h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.tool-card p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.tool-card-benefit {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    font-size: 0.85rem;
}

/* ================================================
   Forms & Inputs
   ================================================ */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 0.875rem 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    color: var(--text-primary);
    font-size: 1rem;
    transition: border-color 0.2s ease;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.form-textarea {
    resize: vertical;
    min-height: 120px;
}

/* ================================================
   Buttons
   ================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    border: none;
    border-radius: 0.75rem;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn-primary {
    background: var(--accent-gradient);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(139, 92, 246, 0.3);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: var(--border-color);
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

/* ================================================
   AI Output Display
   ================================================ */
.ai-output {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), rgba(99, 102, 241, 0.1));
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 1rem;
    padding: 1.5rem;
    margin-top: 1.5rem;
}

.ai-output-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(139, 92, 246, 0.2);
}

.ai-output-icon {
    font-size: 1.5rem;
}

.ai-output-title {
    font-weight: 600;
    color: var(--accent-secondary);
}

.ai-output-content {
    line-height: 1.8;
}

.ai-output-content p {
    margin-bottom: 1rem;
}

.ai-output-content ul {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

.ai-output-content li {
    margin-bottom: 0.5rem;
}

/* ================================================
   Tables
   ================================================ */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    background: var(--bg-tertiary);
}

.data-table tbody tr:hover {
    background: rgba(139, 92, 246, 0.05);
}

/* ================================================
   Progress & Charts
   ================================================ */
.progress-bar {
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: var(--accent-gradient);
    border-radius: 4px;
    transition: width 0.5s ease;
}

.progress-bar-fill.green {
    background: var(--success);
}

.progress-bar-fill.blue {
    background: var(--info);
}

.progress-bar-fill.orange {
    background: var(--warning);
}

/* ================================================
   Student Theme Overrides
   ================================================ */
.student-theme .sidebar {
    background: var(--student-bg-card);
    border-color: #e2e8f0;
}

.student-theme .sidebar-logo-text,
.student-theme .sidebar-nav-link {
    color: var(--student-text);
}

.student-theme .sidebar-nav-link:hover {
    background: #f1f5f9;
}

.student-theme .sidebar-nav-link.active {
    background: var(--student-gradient);
    color: white;
}

.student-theme .main-content {
    background: var(--student-bg);
}

.student-theme .stat-card,
.student-theme .content-card,
.student-theme .tool-card {
    background: var(--student-bg-card);
    border-color: #e2e8f0;
}

.student-theme .form-input,
.student-theme .form-select,
.student-theme .form-textarea {
    background: #f1f5f9;
    border-color: #e2e8f0;
    color: var(--student-text);
}

.student-theme .data-table th {
    background: #f1f5f9;
    color: var(--student-text-secondary);
}

/* ================================================
   Badges & Tags
   ================================================ */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 2rem;
    font-size: 0.8rem;
    font-weight: 500;
}

.badge-success {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.2);
    color: var(--warning);
}

.badge-danger {
    background: rgba(239, 68, 68, 0.2);
    color: var(--danger);
}

.badge-info {
    background: rgba(59, 130, 246, 0.2);
    color: var(--info);
}

.badge-purple {
    background: rgba(139, 92, 246, 0.2);
    color: var(--accent-secondary);
}

/* ================================================
   Animations
   ================================================ */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease forwards;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

.ai-generating {
    animation: pulse 1.5s ease-in-out infinite;
}

/* ================================================
   Responsive Design
   ================================================ */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .mobile-menu-btn {
        display: flex;
    }
}

@media (max-width: 768px) {
    .entry-title {
        font-size: 1.75rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .tools-grid {
        grid-template-columns: 1fr;
    }
}

.mobile-menu-btn {
    display: none;
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 101;
    background: var(--accent-gradient);
    color: white;
    border: none;
    width: 48px;
    height: 48px;
    border-radius: 0.75rem;
    font-size: 1.25rem;
    cursor: pointer;
    align-items: center;
    justify-content: center;
}