/* Myzenstudy - Modern Theme */

:root {
    /* Primary - Blue */
    --primary: #2563eb;
    --primary-light: #3b82f6;
    --primary-dark: #1d4ed8;

    /* Secondary - Emerald */
    --secondary: #10b981;
    --secondary-light: #34d399;
    --secondary-dark: #059669;

    /* Background */
    --bg-light: #f9fafb;
    --bg-card: #ffffff;
    --bg-dark: #0f172a;

    /* Text */
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --text-muted: #9ca3af;

    /* Accent colors for modules */
    --pomodoro-color: #3b82f6;
    --quiz-color: #6366f1;
    --flashcard-color: #10b981;

    /* Status */
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -5px rgba(0,0,0,0.04);

    /* Border radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    /* Sidebar */
    --sidebar-width: 260px;
}

/* Reset */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    background: var(--bg-light);
    color: var(--text-primary);
    min-height: 100vh;
}

/* Typography */
h1 { font-size: 2.25rem; font-weight: 700; line-height: 1.2; }
h2 { font-size: 1.5rem; font-weight: 600; line-height: 1.3; }
h3 { font-size: 1.25rem; font-weight: 600; }
h4 { font-size: 1rem; font-weight: 500; }

/* Top Navigation */
.top-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 70px;
    background: white;
    border-bottom: 1px solid #e5e7eb;
    z-index: 1000;
    box-shadow: var(--shadow-sm);
}

.top-nav-container {
    max-width: 1400px;
    margin: 0 auto;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
}

.top-nav-logo {
    display: flex;
    align-items: center;
    gap: 0px;
    font-size: 1.25rem;
    font-weight: 700;
    color: #000000;
    margin: 0;
}

.top-nav-links {
    display: flex;
    list-style: none;
    gap: 1.5rem;
    margin: 0;
    padding: 0;
    align-items: center;
}

.top-nav-links li {
    display: flex;
    align-items: center;
}

.top-nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
    padding: 0.5rem 1rem;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
}

.top-nav-links a:hover {
    color: var(--primary);
}

.top-nav-links a.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.top-nav-user {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-name {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.logout-btn-top {
    color: var(--text-secondary);
    font-size: 1.2rem;
    transition: color 0.2s;
}

.logout-btn-top:hover {
    color: var(--error);
}

/* Navigation Dropdown */
.nav-dropdown {
    position: relative;
}

.nav-dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    padding: 0.5rem 0;
    font-weight: 500;
    transition: all 0.2s ease;
    border-bottom: 2px solid transparent;
    background: transparent !important;
}

.nav-dropdown-toggle:hover {
    color: var(--primary);
}

.nav-dropdown-toggle.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.nav-dropdown-toggle i {
    font-size: 0.8rem;
    transition: transform 0.3s ease;
}

.nav-dropdown.open .nav-dropdown-toggle i {
    transform: rotate(180deg);
}

.nav-dropdown-menu {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    min-width: 220px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
}

.nav-dropdown.open .nav-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.nav-dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.2s ease;
    border-bottom: 1px solid #f3f4f6;
}

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

.nav-dropdown-item:hover {
    background: #f9fafb;
    color: var(--primary);
}

.nav-dropdown-item i {
    font-size: 1rem;
    width: 20px;
    text-align: center;
    color: var(--primary);
}

/* Sidebar Navigation (deprecated - keeping for compatibility) */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--bg-card);
    border-right: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    z-index: 100;
    box-shadow: var(--shadow-sm);
    display: none; /* Hidden by default */
}

.sidebar-header {
    padding: 24px;
    border-bottom: 1px solid #e5e7eb;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0px;
    font-size: 1.25rem;
    font-weight: 700;
    color: #000000;
}

.logo i {
    font-size: 1.75rem;
    color: #000000;
}

.logo svg {
    width: 32px;
    height: 32px;
}

.nav-links {
    list-style: none;
    padding: 16px 12px;
    flex: 1;
}

.nav-links li {
    margin-bottom: 4px;
}

.nav-links a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
    font-weight: 500;
}

.nav-links a:hover {
    background: #eff6ff;
    color: var(--primary);
}

.nav-links a.active {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.nav-links a i {
    width: 20px;
    text-align: center;
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid #e5e7eb;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px;
    background: #f9fafb;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.guest-badge {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: white;
    padding: 2px 10px;
    border-radius: var(--radius-full);
    font-size: 0.7rem;
    font-weight: 600;
}

.logout-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    color: var(--error);
    text-decoration: none;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
    margin-top: 8px;
    font-weight: 500;
}

.logout-btn:hover {
    background: #fef2f2;
}

/* Main Content */
main {
    min-height: 100vh;
    padding: 32px;
    background: var(--bg-light);
}

main.with-sidebar {
    margin-left: var(--sidebar-width);
}

main.with-top-nav {
    margin-top: 70px;
    min-height: calc(100vh - 70px);
    overflow-y: auto;
}

/* Cards */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid #e5e7eb;
    transition: all 0.2s ease;
}

.card:hover {
    box-shadow: var(--shadow-md);
}

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

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.35);
}

.btn-secondary {
    background: #f3f4f6;
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: #e5e7eb;
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
}

.btn-danger:hover {
    opacity: 0.9;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.8rem;
}

.btn-icon {
    padding: 8px;
    width: 36px;
    height: 36px;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #d1d5db;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    transition: all 0.2s ease;
    background: var(--bg-card);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

textarea.form-control {
    min-height: 100px;
    resize: vertical;
}

/* Alerts */
.alert {
    padding: 16px 20px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.alert-error {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.alert-success {
    background: #ecfdf5;
    color: #059669;
    border: 1px solid #a7f3d0;
}

.alert-close {
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    opacity: 0.7;
}

/* Grid */
.grid {
    display: grid;
    gap: 24px;
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 1024px) {
    .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
    .sidebar { display: none; }
    main.with-sidebar { margin-left: 0; }
}

/* Module Cards (Dashboard) */
.module-card {
    padding: 32px;
    text-align: center;
    cursor: pointer;
    border: none;
    position: relative;
    overflow: hidden;
}

.module-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
}

.module-card.pomodoro::before {
    background: linear-gradient(90deg, var(--primary) 0%, #60a5fa 100%);
}

.module-card.flashcard::before {
    background: linear-gradient(90deg, var(--secondary) 0%, #34d399 100%);
}

.module-card.quiz::before {
    background: linear-gradient(90deg, #6366f1 0%, #a78bfa 100%);
}

.module-card i {
    font-size: 3rem;
    margin-bottom: 16px;
}

.module-card.pomodoro i { color: var(--primary); }
.module-card.flashcard i { color: var(--secondary); }
.module-card.quiz i { color: #6366f1; }

.module-card h3 {
    margin-bottom: 8px;
    color: var(--text-primary);
}

.module-card p {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* Stats Cards */
.stat-card {
    text-align: center;
    padding: 20px;
    background: linear-gradient(135deg, #eff6ff 0%, #ecfdf5 100%);
    border: none;
}

.stat-card .stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-card .stat-label {
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
}

/* Welcome Page */
.welcome-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 32px;
    background: linear-gradient(180deg, #eff6ff 0%, #ecfdf5 50%, var(--bg-light) 100%);
}

.welcome-container .logo {
    font-size: 4rem;
    margin-bottom: 16px;
}

.welcome-container h1 {
    font-size: 3rem;
    margin-bottom: 12px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.welcome-container p {
    color: var(--text-secondary);
    font-size: 1.125rem;
    max-width: 500px;
    margin-bottom: 40px;
}

.welcome-buttons {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    justify-content: center;
}

/* Auth Pages */
.auth-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 32px;
    background: #0f172a;
    overflow: hidden;
}

.auth-card {
    width: 100%;
    max-width: 400px;
    background: transparent !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    border-radius: 12px !important;
    padding: 40px !important;
    box-shadow: none !important;
}

.auth-card .logo {
    justify-content: center;
    margin-bottom: 32px;
    font-size: 1.5rem;
    color: #ffffff;
}

.auth-card .logo span {
    color: #ffffff;
}

.auth-card h2 {
    color: #fff;
}

.auth-card .form-control {
    background: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
}

.auth-card .form-control:focus {
    border-color: #14B8A6;
    background: #1e293b;
}

.auth-card label {
    color: rgba(255, 255, 255, 0.7);
}

.auth-card .btn-primary {
    background: linear-gradient(135deg, #10b981 0%, #14B8A6 50%, #3B82F6 100%);
    color: white;
    border: none;
    box-shadow: none;
    font-weight: 600;
}

.auth-card .btn-primary:hover {
    background: linear-gradient(135deg, #059669 0%, #0D9488 50%, #2563EB 100%);
    border-color: transparent;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(20, 184, 166, 0.4);
}

.auth-footer {
    text-align: center;
    margin-top: 24px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.875rem;
}

.auth-footer a {
    color: #14B8A6;
    text-decoration: none;
    font-weight: 500;
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* Pomodoro Timer */
.timer-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px;
}

.timer-display {
    position: relative;
    width: 300px;
    height: 300px;
    margin-bottom: 32px;
}

.timer-circle {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: var(--bg-card);
    box-shadow: var(--shadow-xl);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    border: 8px solid #eff6ff;
}

.timer-time {
    font-size: 4rem;
    font-weight: 700;
    color: var(--text-primary);
}

.timer-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 3px;
    font-weight: 600;
}

.timer-controls {
    display: flex;
    gap: 16px;
    margin-bottom: 32px;
}

.timer-btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    transition: all 0.2s;
}

.timer-btn.primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    width: 72px;
    height: 72px;
    font-size: 1.5rem;
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.35);
}

.timer-btn.primary:hover {
    transform: scale(1.05);
    box-shadow: 0 12px 28px rgba(37, 99, 235, 0.45);
}

.timer-btn.secondary {
    background: #f3f4f6;
    color: var(--text-secondary);
}

.timer-btn.secondary:hover {
    background: #e5e7eb;
}

.session-type-btns {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
}

.session-type-btn {
    padding: 10px 24px;
    border: 2px solid #e5e7eb;
    background: transparent;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.875rem;
    font-weight: 500;
}

.session-type-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.session-type-btn.active {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    border-color: transparent;
    color: white;
}

/* Flashcard Study */
.flashcard-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px;
}

.flashcard {
    width: 100%;
    max-width: 500px;
    height: 300px;
    perspective: 1000px;
    cursor: pointer;
    margin-bottom: 32px;
}

.flashcard-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.flashcard.flipped .flashcard-inner {
    transform: rotateY(180deg);
}

.flashcard-front, .flashcard-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: var(--radius-lg);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 32px;
    font-size: 1.5rem;
    text-align: center;
    box-shadow: var(--shadow-xl);
}

.flashcard-front {
    background: var(--bg-card);
    border: 3px solid #a7f3d0;
}

.flashcard-back {
    background: linear-gradient(135deg, var(--secondary) 0%, var(--secondary-light) 100%);
    color: white;
    transform: rotateY(180deg);
}

.rating-buttons {
    display: flex;
    gap: 12px;
}

.rating-btn {
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.2s;
}

.rating-btn.again {
    background: linear-gradient(135deg, #ef4444 0%, #f87171 100%);
    color: white;
}
.rating-btn.hard {
    background: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);
    color: white;
}
.rating-btn.good {
    background: linear-gradient(135deg, #3b82f6 0%, #60a5fa 100%);
    color: white;
}
.rating-btn.easy {
    background: linear-gradient(135deg, #10b981 0%, #34d399 100%);
    color: white;
}

.rating-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Lists */
.item-list {
    list-style: none;
}

.item-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid #e5e7eb;
}

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

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

/* Progress Bar */
.progress-bar {
    height: 8px;
    background: #e5e7eb;
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-bar .progress {
    height: 100%;
    background: linear-gradient(90deg, var(--primary) 0%, var(--secondary) 100%);
    border-radius: var(--radius-full);
    transition: width 0.3s;
}

/* Badge */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-primary {
    background: #dbeafe;
    color: var(--primary);
}
.badge-success {
    background: #d1fae5;
    color: var(--secondary-dark);
}
.badge-warning {
    background: #fef3c7;
    color: #b45309;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 16px;
    color: #d1d5db;
}

.empty-state h3 {
    margin-bottom: 8px;
    color: var(--text-primary);
}

/* Quiz */
.quiz-question {
    margin-bottom: 32px;
}

.quiz-question h3 {
    margin-bottom: 16px;
}

.quiz-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.quiz-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border: 2px solid #e5e7eb;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
}

.quiz-option:hover {
    border-color: #6366f1;
    background: #eef2ff;
}

.quiz-option.selected {
    border-color: #6366f1;
    background: #eef2ff;
}

.quiz-option.correct {
    border-color: var(--success);
    background: #ecfdf5;
}

.quiz-option.incorrect {
    border-color: var(--error);
    background: #fef2f2;
}

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

.fade-in {
    animation: fadeIn 0.3s ease;
}

/* Utility Classes */
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.flex { display: flex; }
.flex-between { justify-content: space-between; }
.flex-center { justify-content: center; }
.gap-2 { gap: 16px; }
