/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600;700&family=Inter:wght@400;500;600&family=JetBrains+Mono:wght@400;500&display=swap');

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

:root {
    --bg-primary: #F9FAFB;
    --bg-secondary: #FFFFFF;
    --bg-tertiary: #F9FAFB;
    --text-primary: #111827;
    --text-secondary: #111827;
    --text-muted: #6B7280;
    --primary-color: #2563EB;
    --primary-hover: #1D4ED8;
    --border-color: #E5E7EB;
    --border-light: #F3F4F6;
    --nav-hover: #DBEAFE;
}

body.dark-theme {
    --bg-primary: #020617;
    --bg-secondary: #0F172A;
    --bg-tertiary: #1E293B;
    --text-primary: #E5E7EB;
    --text-secondary: #E5E7EB;
    --text-muted: #94A3B8;
    --primary-color: #38BDF8;
    --primary-hover: #0EA5E9;
    --border-color: #1E293B;
    --border-light: #0F172A;
    --nav-hover: #075985;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-primary);
    min-height: 100vh;
    padding: 20px;
    color: var(--text-primary);
    transition: background 0.3s ease, color 0.3s ease;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-weight: 600;
}

code,
pre {
    font-family: 'JetBrains Mono', 'Courier New', monospace;
}

/* Header */
header {
    text-align: center;
    color: var(--primary-color);
    margin-bottom: 30px;
}

header h1 {
    font-size: 2.5rem;
}

/* Navigation */
.main-nav {
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 30px;
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.nav-link {
    padding: 10px 20px;
    text-decoration: none;
    color: var(--text-primary);
    border-radius: 6px;
    background: var(--bg-tertiary);
    transition: all 0.3s ease;
}

.nav-link:hover {
    background: var(--nav-hover);
    color: var(--primary-color);
}

.nav-link.active {
    background: var(--primary-color);
    color: white;
}

/* Theme Toggle */
.theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    color: var(--text-primary);
    padding: 10px 14px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.3rem;
    transition: all 0.3s ease;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.theme-toggle:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: scale(1.05);
}

/* Sections */
section {
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 30px;
    margin-bottom: 30px;
}

section h2 {
    color: var(--primary-color);
    margin-bottom: 20px;
}

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

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: var(--text-secondary);
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 10px;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    background: var(--bg-secondary);
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
    width: 100%;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-danger {
    background: transparent;
    color: #DC2626;
    border: 1px solid #FCA5A5;
}

.btn-danger:hover {
    background: #DC2626;
    color: #ffffff;
    border-color: #DC2626;
}

.btn-view {
    flex: 1;
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

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

/* Section Header */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.section-header h2 {
    margin-bottom: 0;
}

/* Subjects List */
.subjects-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
}

.empty-state {
    text-align: center;
    color: var(--text-muted);
    padding: 40px;
}

/* Subject Card */
.subject-card {
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    background: var(--bg-secondary);
}

.subject-card.priority-high {
    border-left: 5px solid #EF4444;
}

.subject-card.priority-medium {
    border-left: 5px solid #F59E0B;
}

.subject-card.priority-low {
    border-left: 5px solid #22C55E;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-light);
}

.card-header h3 {
    margin: 0;
    color: var(--text-secondary);
}

.priority-badge {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
}

.priority-badge.high {
    background: #FEE2E2;
    color: #EF4444;
}

.priority-badge.medium {
    background: #FEF3C7;
    color: #F59E0B;
}

.priority-badge.low {
    background: #D1FAE5;
    color: #22C55E;
}

.card-body {
    margin-bottom: 15px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.info-row .label {
    color: var(--text-muted);
}

.info-row .value {
    font-weight: 600;
    color: var(--text-secondary);
}

.info-row .value.urgent {
    color: #EF4444;
}

.card-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--border-light);
}

.card-actions .btn {
    flex: 1;
}

.btn-edit {
    background: #3B82F6;
    color: white;
}

.btn-delete {
    background: transparent;
    color: #DC2626;
    border: 1px solid #FCA5A5;
}

.btn-delete:hover {
    background: #DC2626;
    color: #ffffff;
    border-color: #DC2626;
}

/* Dashboard */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.dashboard-card {
    background: var(--primary-color);
    color: white;
    padding: 25px;
    border-radius: 8px;
    text-align: center;
}

.dashboard-card h3 {
    font-size: 2.5rem;
    margin: 10px 0;
}

.dashboard-sections {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.dashboard-section {
    background: var(--bg-tertiary);
    padding: 20px;
    border-radius: 8px;
}

.dashboard-section h3 {
    color: var(--primary-color);
    margin-bottom: 15px;
}

.priority-list,
.today-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.priority-item,
.today-item {
    background: var(--bg-secondary);
    padding: 12px;
    border-radius: 6px;
    border-left: 4px solid var(--primary-color);
}

.empty-dash {
    text-align: center;
    color: var(--text-muted);
    padding: 20px;
}

/* Statistics */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.stat-card {
    background: var(--primary-color);
    color: white;
    padding: 30px;
    border-radius: 8px;
    text-align: center;
}

.stat-card h3 {
    font-size: 3rem;
}

/* Schedule */
.schedule-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.schedule-display-section {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 2px solid var(--border-light);
}

#view-schedule {
    color: var(--primary-color);
    font-size: 1.8rem;
    text-align: center;
    margin-bottom: 25px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.empty-schedule {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
}

/* Daily View */
.schedule-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.schedule-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: var(--bg-tertiary);
    border-radius: 6px;
    border-left: 4px solid var(--primary-color);
}

.schedule-time {
    font-weight: 600;
    color: var(--primary-color);
    min-width: 150px;
}

.schedule-subject {
    flex: 1;
    color: var(--text-secondary);
}

.btn-delete-schedule {
    background: transparent;
    color: #DC2626;
    border: 1px solid #FCA5A5;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-delete-schedule:hover {
    background: #DC2626;
    color: #ffffff;
    border-color: #DC2626;
}

/* Weekly View */
.weekly-view {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
}

.day-column {
    background: var(--bg-tertiary);
    border-radius: 6px;
    padding: 15px;
}

.day-column h4 {
    color: var(--primary-color);
    margin-bottom: 15px;
    text-align: center;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary-color);
}

.day-schedules {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.no-schedule {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    padding: 20px 0;
}

.schedule-item-small {
    background: var(--bg-secondary);
    padding: 10px;
    border-radius: 6px;
    border-left: 3px solid var(--primary-color);
    position: relative;
}

.time-small {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 5px;
}

.subject-small {
    font-size: 0.9rem;
    padding-right: 25px;
    color: var(--text-secondary);
}

.btn-delete-small {
    position: absolute;
    top: 5px;
    right: 5px;
    background: transparent;
    color: #DC2626;
    border: 1px solid #FCA5A5;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
}

.btn-delete-small:hover {
    background: #DC2626;
    color: #ffffff;
    border-color: #DC2626;
}

/* Responsive */
@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }

    .subjects-list {
        grid-template-columns: 1fr;
    }

    .section-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }

    .section-header .btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }

    section {
        padding: 20px;
    }

    header h1 {
        font-size: 1.5rem;
    }
}