/* Importing Google Fonts - Poppins */
@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,400;0,600;0,700;1,500&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
      font-family: "Poppins", sans-serif;
}

:root {
     /* Light theme colors */
  --color-text-primary: #1F2936;
  --color-text-placeholder: #798EAE;
  --color-bg-primary: #f9fafb;
  --color-bg-secondary: #ECECFD;
  --color-bg-sidebar: #FFFFFF;
  --color-border-hr: #E2E8F0;
  --color-hover-primary: #695CFE;
  --color-hover-secondary: #e2e2fb;
  --color-shadow: rgba(0, 0, 0, 0.05);
    /* Event colors */
    --color-blue: #4285f4;
    --color-red: #ea4335;
    --color-green: #34a853;
    --color-yellow: #fbbc04;
    --color-purple: #9334e6;
    --color-orange: #f29900;
    --color-pink: #d81b60;
}

body.dark-theme {
     /* Dark theme colors */
  --color-text-primary: #F1F5F9;
  --color-text-placeholder: #A6B7D2;
  --color-bg-primary: #111827;
  --color-bg-secondary: #3D4859;
  --color-bg-sidebar: #1f2937;
  --color-border-hr: #3B475C;
  --color-hover-secondary: #48566a;
  --color-shadow: rgba(0, 0, 0, 0.3);
    --color-blue: #8ab4f8;
    --color-red: #f28b82;
    --color-green: #81c995;
    --color-yellow: #fdd663;
    --color-purple: #c58af9;
    --color-orange: #f6ad55;
    --color-pink: #f48fb1;
}

body {
    background: var(--color-bg-primary);
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    width: 270px;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    background: var(--color-bg-sidebar);
    border-right: 1px solid var(--color-border-hr);
    box-shadow: 0 3px 9px var(--color-shadow);
    transition: width 0.4s ease;
}

.sidebar.collapsed {
    width: 90px;
}

.sidebar .sidebar-header {
    display: flex;
    padding: 20px 18px;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--color-border-hr);
}

.sidebar-header .header-logo {
    width: 50px;
    height: 50px;
    object-fit: cover;
    display: block;
    border-radius: 100%;
    transition: opacity 0.4s ease;
}

.sidebar.collapsed .sidebar-header .header-logo {
    opacity: 0;
    pointer-events: none;
}

.site-nav .sidebar-toggle,
.sidebar-header .sidebar-toggle {
    height: 40px;
    width: 40px;
    border: none;
    position: absolute;
    right: 18px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-primary);
    background: var(--color-bg-secondary);
    transition: 0.4s ease;
}

.sidebar.collapsed .sidebar-header .sidebar-toggle {
    height: 48px;
    width: 50px;
    transform: translateX(-2px);
}

.site-nav .sidebar-toggle:hover,
.sidebar-header .sidebar-toggle:hover {
    background: var(--color-hover-secondary);
}

.sidebar-header .sidebar-toggle span {
    font-size: 1.75rem;
    transition: transform 0.4s ease;
}

.sidebar.collapsed .sidebar-toggle span {
    transform: rotate(180deg);
}

.sidebar .sidebar-content {
    flex: 1;
    padding: 20px 18px;
    overflow: hidden auto;
    scrollbar-width: thin;
    scrollbar-color: var(--color-text-placeholder) transparent;
}

.sidebar.collapsed .sidebar-content {
    scrollbar-width: none;
}

.sidebar-content .search-form {
    min-height: 48px;
    border-radius: 8px;
    display: flex;
    padding: 0 15px;
    margin: 5px 0 20px;
    align-items: center;
    white-space: nowrap;
    background: var(--color-bg-secondary);
    transition: 0.4s ease;
}

.sidebar.sidebar.collapsed .sidebar-content .search-form:hover {
    cursor: pointer;
}

.sidebar.sidebar.collapsed .sidebar-content .search-form:hover,
.sidebar-content .search-form:focus-within {
    background: var(--color-hover-secondary);
}

.search-form input {
    border: none;
    background: none;
    outline: none;
    font-size: 1rem;
    width: 100%;
    margin-left: 15px;
    color: var(--color-text-primary);
}

.search-form span {
    color: var(--color-text-placeholder);
}

.search-form input::placeholder {
    color: var(--color-text-placeholder);
}

.sidebar-content .menu-list {
    display: flex;
    gap: 4px;
    flex-direction: column;
    list-style: none;
}

.menu-list .menu-link {
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 12px;
    white-space: nowrap;
    padding: 12px 15px;
    border-radius: 8px;
    color: var(--color-text-primary);
    transition: 0.3s ease;
}

.menu-link .menu-label {
    transition: 0.3s ease;
}

.sidebar.collapsed .menu-link .menu-label {
    opacity: 0;
    pointer-events: none;
}

.menu-list .menu-link:is(:hover, .active) {
    color: #fff;
    background: var(--color-hover-primary);
}

.sidebar .sidebar-footer {
    padding: 20px 18px;
    white-space: nowrap;
    border-top: 1px solid var(--color-border-hr);
}

.sidebar-footer .theme-toggle {
    width: 100%;
    min-height: 48px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    padding: 0 15px;
    display: flex;
    align-items: center;
    color: var(--color-text-primary);
    background: var(--color-bg-secondary);
    transition: 0.3s ease;
}

.sidebar-footer .theme-toggle:hover {
    background: var(--color-hover-secondary);
}

.theme-toggle .theme-label {
    display: flex;
    gap: 10px;
    align-items: center;
}

.theme-toggle .theme-label .theme-text {
    font-size: 1rem;
    transition: opacity 0.4s 0.2s ease;
}

.sidebar.collapsed .theme-toggle :where(.theme-text, .theme-toggle-track) {
    width: 0;
    opacity: 0;
    transition: all 0.2s ease;
}

/* Logout Button */
.sidebar-footer .logout-btn {
    width: 100%;
    min-height: 48px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    padding: 0 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: white;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    transition: all 0.3s ease;
    font-weight: 600;
    font-size: 1rem;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
    margin-top: 10px;
}

.sidebar-footer .logout-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(239, 68, 68, 0.4);
}

.sidebar-footer .logout-btn:active {
    transform: translateY(0);
}

.sidebar-footer .logout-btn span.material-symbols-rounded {
    font-size: 1.2rem;
}

.sidebar.collapsed .logout-btn .theme-text {
    width: 0;
    opacity: 0;
    transition: all 0.2s ease;
}

.theme-toggle .theme-toggle-track {
    height: 24px;
    width: 48px;
    position: relative;
    border-radius: 999px;
    margin-left: auto;
    background: #c3d1ec;
    transition: opacity 0.4s 0.2s ease, background-color 0.3s ease;
}

body.dark-theme .theme-toggle .theme-toggle-track {
    background: #695CFE;
}

.theme-toggle-track .theme-toggle-indicator {
    position: absolute;
    top: 3px;
    left: 3px;
    height: 18px;
    width: 18px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.01);
    transition: transform 0.3s ease;
}

body.dark-theme .theme-toggle-track .theme-toggle-indicator {
    transform: translateX(24px);
}

.site-nav {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 64px;
    padding: 12px 16px;
    background: var(--color-bg-primary);
    border-bottom: 1px solid var(--color-border-hr);
    z-index: 30;
    align-items: center;
}

.site-nav .sidebar-toggle {
    position: unset;
}

.container {
    display: flex;
}

.container .main-content {
    flex: 1;
    padding: 30px;
    color: var(--color-text-primary);
    animation: popIn 0.3s ease;
}

.main-content .page-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 20px;
}

.main-content .card {
    border-radius: 8px;
    padding: 20px;
    background-color: var(--color-bg-sidebar);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Global popup animation keyframes */
@keyframes popIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

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

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

@media (max-width: 768px) {
    body::before {
        content: "";
        position: fixed;
        inset: 0;
        z-index: 10;
        opacity: 0;
        pointer-events: none;
        background: rgba(0, 0, 0, 0.6);
        transition: 0.4s ease;
    }

    body:has(.sidebar:not(.collapsed))::before {
        opacity: 1;
        pointer-events: auto;
    }

    .site-nav {
        display: flex;
    }

    .container {
        padding-top: 64px; /* offset fixed top nav to avoid overlap */
    }

    .sidebar {
        position: fixed;
        left: 0;
        width: 270px;
        height: 100%;
        z-index: 20;
        transition: left 0.4s ease;
    }

    .sidebar.collapsed {
        left: -270px;
        width: 270px;
    }
}

/* ============ DASHBOARD STYLES ============ */

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2.5rem;
    flex-wrap: wrap;
    gap: 2rem;
}

.header-left {
    flex: 1;
    min-width: 200px;
}

.page-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-text-primary);
    margin-bottom: 0.5rem;
}

.page-subtitle {
    font-size: 0.95rem;
    color: var(--color-text-placeholder);
    font-weight: 500;
}

.greeting-card {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    background: linear-gradient(135deg, var(--color-hover-primary), #7d6ff7);
    color: white;
    padding: 1.75rem 2.25rem;
    border-radius: 1rem;
    flex-shrink: 0;
    box-shadow: 0 8px 24px rgba(105, 92, 254, 0.25);
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.greeting-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(105, 92, 254, 0.35);
}

.greeting-icon {
    font-size: 3rem;
    animation: wave 2s ease-in-out infinite;
}

@keyframes wave {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(20deg); }
    75% { transform: rotate(-10deg); }
}

.greeting-content {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.greeting-text {
    font-size: 1.2rem;
    font-weight: 700;
}

.greeting-subtitle {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* Statistics Container */
.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.75rem;
    margin-bottom: 2.5rem;
}

.stat-card {
    background: var(--color-bg-secondary);
    padding: 1.75rem;
    border-radius: 1rem;
    border: 1px solid var(--color-border-hr);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    border-radius: 1rem 1rem 0 0;
    background: var(--color-hover-primary);
}

.stat-card-1::before { background: linear-gradient(90deg, #695CFE, #7d6ff7); }
.stat-card-2::before { background: linear-gradient(90deg, #10b981, #34d399); }
.stat-card-3::before { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.stat-card-4::before { background: linear-gradient(90deg, #ef4444, #f87171); }

.stat-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 24px var(--color-shadow);
    border-color: var(--color-hover-primary);
}

.stat-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.stat-icon-circle {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(105, 92, 254, 0.15);
    color: var(--color-hover-primary);
}

.stat-card-2 .stat-icon-circle { background: rgba(16, 185, 129, 0.15); color: #10b981; }
.stat-card-3 .stat-icon-circle { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }
.stat-card-4 .stat-icon-circle { background: rgba(239, 68, 68, 0.15); color: #ef4444; }

.stat-icon {
    font-size: 1.5rem;
}

.stat-header h3 {
    font-size: 0.85rem;
    color: var(--color-text-placeholder);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--color-text-primary);
    margin-bottom: 0.5rem;
    line-height: 1;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--color-text-placeholder);
}

/* Widgets Grid */
.widgets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.widget-card {
    background: var(--color-bg-secondary);
    padding: 1.75rem;
    border-radius: 1rem;
    border: 1px solid var(--color-border-hr);
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px var(--color-shadow);
}

.widget-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 28px var(--color-shadow);
    border-color: var(--color-hover-primary);
}

.widget-card.highlight {
    background: linear-gradient(135deg, rgba(105, 92, 254, 0.08), rgba(125, 111, 247, 0.08));
    border: 1px solid rgba(105, 92, 254, 0.3);
}

body.dark-theme .widget-card.highlight {
    background: linear-gradient(135deg, rgba(105, 92, 254, 0.15), rgba(125, 111, 247, 0.12));
}

.widget-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--color-border-hr);
}

.widget-header h2 {
    font-size: 1.15rem;
    color: var(--color-text-primary);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.view-all-link {
    color: var(--color-hover-primary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.view-all-link:hover {
    gap: 0.6rem;
    opacity: 0.8;
}

/* Lists in Widgets */
.upcoming-list,
.classes-list,
.recent-notes {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.upcoming-list li,
.classes-list li,
.recent-notes li {
    background: var(--color-bg-primary);
    padding: 0.95rem 1.2rem;
    border-radius: 0.75rem;
    border-left: 3px solid var(--color-hover-primary);
    color: var(--color-text-primary);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
    font-size: 0.95rem;
}

.upcoming-list li:hover,
.classes-list li:hover,
.recent-notes li:hover {
    background: var(--color-hover-secondary);
    transform: translateX(6px);
    box-shadow: 0 4px 12px var(--color-shadow);
}

.upcoming-list .empty-state,
.classes-list .empty-state,
.recent-notes .empty-state {
    text-align: center;
    color: var(--color-text-placeholder);
    border-left: none;
    font-size: 0.95rem;
    padding: 2rem 1rem;
}

.upcoming-list,
.classes-list,
.recent-notes {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.upcoming-list li,
.classes-list li,
.recent-notes li {
    background: var(--color-bg-primary);
    padding: 0.95rem 1.2rem;
    border-radius: 0.75rem;
    border-left: 3px solid var(--color-hover-primary);
    color: var(--color-text-primary);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
    font-size: 0.95rem;
}

.upcoming-list li:hover,
.classes-list li:hover,
.recent-notes li:hover {
    background: var(--color-hover-secondary);
    transform: translateX(6px);
    box-shadow: 0 4px 12px var(--color-shadow);
}

.upcoming-list li.completed,
.classes-list li.completed,
.recent-notes li.completed {
    opacity: 0.6;
}

.upcoming-list li.completed strong,
.classes-list li.completed strong,
.recent-notes li.completed strong {
    text-decoration: line-through;
    color: var(--color-text-placeholder);
}

.upcoming-list .empty-state,
.classes-list .empty-state,
.recent-notes .empty-state {
    text-align: center;
    color: var(--color-text-placeholder);
    border-left: none;
    font-size: 0.95rem;
    padding: 2rem 1rem;
}

.task-priority {
    font-size: 0.7rem;
    padding: 0.35rem 0.85rem;
    border-radius: 0.4rem;
    background: rgba(105, 92, 254, 0.1);
    color: var(--color-hover-primary);
    border: none;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.task-priority.high {
    background: rgba(255, 107, 107, 0.1);
    color: #ff6b6b;
}

.task-priority.medium {
    background: rgba(255, 193, 7, 0.1);
    color: #ffc107;
}

.task-priority.low {
    background: rgba(76, 175, 80, 0.1);
    color: #4caf50;
}

.class-time {
    font-size: 0.85rem;
    color: var(--color-text-placeholder);
    background: rgba(105, 92, 254, 0.1);
    padding: 0.4rem 0.8rem;
    border-radius: 0.4rem;
}

/* Streak Widget */
.streak-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    padding: 1.5rem 1rem;
}

.streak-number {
    font-size: 3.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, #ff6b6b, #ff8787);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
}

.streak-text {
    font-size: 1rem;
    color: var(--color-text-primary);
    font-weight: 600;
}

.streak-btn {
    background: linear-gradient(135deg, var(--color-hover-primary), #7d6ff7);
    color: white;
    border: none;
    padding: 0.9rem 1.8rem;
    border-radius: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.95rem;
    box-shadow: 0 4px 12px rgba(105, 92, 254, 0.3);
}

.streak-btn:hover {
    background: linear-gradient(135deg, #5a50e8, #6d5fe5);
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(105, 92, 254, 0.4);
}

/* Quick Links */
.quick-links {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.quick-link-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1.2rem;
    background: var(--color-bg-primary);
    border: 2px solid var(--color-border-hr);
    border-radius: 0.75rem;
    color: var(--color-text-primary);
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    font-weight: 600;
}

.quick-link-btn:hover {
    border-color: var(--color-hover-primary);
    background: var(--color-hover-secondary);
    color: var(--color-hover-primary);
    transform: translateY(-4px);
    box-shadow: 0 8px 16px var(--color-shadow);
}

.quick-link-btn span:first-child {
    font-size: 1.8rem;
}

/* Quote Card */
.quote-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.25rem;
    text-align: center;
    padding: 2.5rem 2rem;
    background: linear-gradient(135deg, rgba(105, 92, 254, 0.08), rgba(125, 111, 247, 0.08));
    border: 2px solid var(--color-hover-primary);
    border-style: dashed;
}

body.dark-theme .quote-card {
    background: linear-gradient(135deg, rgba(105, 92, 254, 0.12), rgba(125, 111, 247, 0.1));
}

.quote-icon {
    font-size: 2.5rem;
}

.quote-text {
    font-size: 0.95rem;
    color: var(--color-text-primary);
    font-style: italic;
    line-height: 1.7;
    font-weight: 500;
}

.new-quote-btn {
    background: linear-gradient(135deg, var(--color-hover-primary), #7d6ff7);
    color: white;
    border: none;
    padding: 0.7rem 1.4rem;
    border-radius: 0.5rem;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(105, 92, 254, 0.2);
}

.new-quote-btn:hover {
    background: linear-gradient(135deg, #5a50e8, #6d5fe5);
    transform: scale(1.08);
    box-shadow: 0 6px 16px rgba(105, 92, 254, 0.3);
}

/* Responsive Design */
@media (max-width: 768px) {
    .dashboard-header {
        flex-direction: column;
        align-items: stretch;
        gap: 1.5rem;
    }

    .greeting-card {
        width: 100%;
        min-width: unset;
    }

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

    .widgets-grid {
        grid-template-columns: 1fr;
    }

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

    .page-title {
        font-size: 1.75rem;
    }
}

@media (max-width: 480px) {
    .stats-container {
        grid-template-columns: 1fr;
    }

    .greeting-card {
        padding: 1.25rem 1.5rem;
    }

    .greeting-icon {
        font-size: 2.5rem;
    }

    .widget-header h2 {
        font-size: 1rem;
    }

    .stat-number {
        font-size: 2rem;
    }

    .page-title {
        font-size: 1.5rem;
    }
}

