/* --- 1. MODERN THEME VARIABLES --- */
:root {
    --bg-color: #f8fafc;
    --sidebar-bg: #ffffff;
    --card-bg: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --accent-gradient: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
}

body.dark-mode {
    --bg-color: #0f172a;
    --sidebar-bg: #1e293b;
    --card-bg: #1e293b;
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --border-color: #334155;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    transition: background-color 0.3s ease, color 0.3s ease;
    height: 100vh;
    display: flex;
    overflow: hidden;
}

h1,
h2,
h3 {
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
}

input,
select,
button {
    font-family: 'Inter', sans-serif;
}

/* FIX: Ensure Dashboard takes full width so scrollbar is at the edge */
#dashboard-screen {
    width: 100%;
    height: 100%;
    flex: 1;
}

/* --- LANDING PAGE --- */
.landing-container {
    width: 100vw;
    min-height: 100vh;
    background-color: var(--bg-color);
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow-x: hidden;
    background-image: radial-gradient(var(--border-color) 1px, transparent 1px);
    background-size: 30px 30px;
}

.landing-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2rem 5%;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    z-index: 10;
    position: relative;
}

.logo {
    font-weight: 700;
    font-size: 1.25rem;
    font-family: 'Poppins', sans-serif;
}

.btn-text {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-weight: 500;
    font-size: 1rem;
}

.hero-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 5%;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    gap: 4rem;
    position: relative;
}

.hero-text {
    max-width: 500px;
    z-index: 10;
    position: relative;
}

/* FIXED CSS SYNTAX ERROR BELOW */
.hero-text h1 {
    font-size: 3.5rem;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, var(--text-main) 0%, var(--primary) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-text p {
    font-size: 1.125rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

.feature-pills {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.feature-pills span {
    font-size: 0.85rem;
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
    padding: 5px 12px;
    border-radius: 20px;
    font-weight: 500;
}

.hero-graphic {
    position: relative;
    width: 400px;
    height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.circle-bg {
    width: 350px;
    height: 350px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(168, 85, 247, 0.2));
    filter: blur(40px);
    position: absolute;
    z-index: 0;
}

.floating-card {
    position: absolute;
    background: var(--card-bg);
    padding: 1.25rem;
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    min-width: 180px;
    z-index: 1;
    animation: float 6s ease-in-out infinite;
}

.card-1 {
    top: 20%;
    left: 0;
    transform: rotate(-5deg);
}

.card-2 {
    bottom: 20%;
    right: 0;
    transform: rotate(5deg);
    animation-delay: 3s;
}

@keyframes float {
    0% {
        transform: translateY(0px) rotate(-5deg);
    }

    50% {
        transform: translateY(-15px) rotate(-5deg);
    }

    100% {
        transform: translateY(0px) rotate(-5deg);
    }
}

footer {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* --- DASHBOARD & SIDEBAR --- */
.sidebar {
    width: 260px;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    transition: background-color 0.3s;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-color);
    border-radius: 12px;
    margin-bottom: 2rem;
    border: 1px solid var(--border-color);
}

#user-photo {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.user-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
    line-height: 1.3;
}

.user-text span {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-main);
}

.user-text small {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.nav-links {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
    overflow-y: auto;
}

.nav-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 12px;
    border-radius: 8px;
    text-align: left;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-btn:hover {
    background: var(--bg-color);
    color: var(--text-main);
}

.nav-btn.active {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
    font-weight: 600;
}

.nav-footer {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.content {
    flex: 1;
    padding: 2.5rem;
    overflow-y: auto;
    background-color: var(--bg-color);
}

header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 2.5rem;
}

/* --- CARDS & LISTS --- */
.card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s, border-color 0.2s;
}

.card:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.assignment-item {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    transition: transform 0.2s;
}

.assignment-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.assignment-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.btn-icon {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    cursor: pointer;
}

.btn-icon:hover {
    background: var(--bg-color);
    color: var(--primary);
    border-color: var(--primary);
}

.course-list-styled {
    list-style: none;
    margin-top: 1rem;
}

.course-list-styled li {
    background: var(--card-bg);
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.course-list-styled li:first-child {
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
}

.course-list-styled li:last-child {
    border-bottom: none;
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
}

/* --- BUTTONS & INPUTS --- */
.btn-primary {
    background: var(--accent-gradient);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: filter 0.2s;
}

.btn-primary:hover {
    filter: brightness(110%);
}

.btn-google {
    background-color: #ffffff;
    color: #1f1f1f;
    border: 1px solid #dadce0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-weight: 500;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    border-radius: 8px;
    padding: 0.75rem 1.5rem;
    transition: background-color 0.2s, box-shadow 0.2s;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.btn-google:hover {
    background-color: #f8faff;
    border-color: #d2e3fc;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.btn-google svg {
    width: 20px;
    height: 20px;
    min-width: 20px;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-outline:hover {
    background: var(--bg-color);
    border-color: var(--text-muted);
}

.btn-logout {
    background: transparent;
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.2);
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    text-align: center;
}

.btn-logout:hover {
    background: #ef4444;
    color: white;
}

.btn-danger-outline {
    margin-top: 2rem;
    background: transparent;
    border: 1px solid #ef4444;
    color: #ef4444;
    padding: 10px;
    border-radius: 8px;
    width: 100%;
    cursor: pointer;
}

input,
select {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-color);
    color: var(--text-main);
    outline: none;
    margin-bottom: 10px;
}

input:focus,
select:focus {
    border-color: var(--primary);
}

.input-group-row {
    display: flex;
    gap: 10px;
}

.input-group-row input {
    margin-bottom: 0;
}

.row {
    display: flex;
    gap: 15px;
}

.row>div {
    flex: 1;
}

.full-width {
    width: 100%;
}

/* --- MODALS & EXTRAS --- */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 100;
}

.modal-content {
    background: var(--card-bg);
    margin: 5% auto;
    padding: 2rem;
    width: 100%;
    max-width: 450px;
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    animation: popIn 0.3s ease;
}

.close {
    float: right;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
}

/* --- TRANSCRIPT STYLES --- */
.sem-summary {
    background: var(--bg-color);
    padding: 12px;
    border-radius: 8px;
    margin-top: 15px;
    margin-bottom: 5px;
    border: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sem-summary h4 {
    margin: 0;
    font-size: 1rem;
    color: var(--text-main);
}

.badges {
    display: flex;
    gap: 10px;
}

.stat-badge {
    font-size: 0.8rem;
    padding: 4px 10px;
    border-radius: 6px;
    font-weight: 600;
}

.stat-badge.blue {
    background: #dbeafe;
    color: #1e40af;
}

.stat-badge.green {
    background: #d1fae5;
    color: #065f46;
}

.transcript-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    background: var(--card-bg);
}

.transcript-table th {
    text-align: left;
    padding: 10px;
    background: var(--bg-color);
    border-bottom: 2px solid var(--border-color);
    color: var(--text-muted);
}

.transcript-table td {
    padding: 10px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-main);
}

.grade-badge {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
}

.grade-hd {
    background: #d1fae5;
    color: #065f46;
}

.grade-d {
    background: #dbeafe;
    color: #1e40af;
}

.grade-c {
    background: #fef3c7;
    color: #92400e;
}

.grade-p {
    background: #f3f4f6;
    color: #374151;
}

.grade-n {
    background: #fee2e2;
    color: #b91c1c;
}

/* --- ANIMATIONS --- */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.7);
    }

    70% {
        transform: scale(1.05);
        box-shadow: 0 0 0 10px rgba(99, 102, 241, 0);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(99, 102, 241, 0);
    }
}

@keyframes popIn {
    0% {
        opacity: 0;
        transform: scale(0.9);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.card,
.stat-card {
    animation: fadeInUp 0.6s ease-out forwards;
}

.assignment-item {
    animation: fadeInUp 0.5s ease-out forwards;
    opacity: 0;
    animation-delay: 0.2s;
}

.pulse-animation {
    animation: pulse 2s infinite;
}

.fade-in-up {
    animation: fadeInUp 0.8s ease-out forwards;
}

.fade-in-down {
    animation: fadeInDown 0.8s ease-out forwards;
}

.fade-in-right {
    animation: fadeInRight 0.8s ease-out forwards;
}

@media (max-width: 900px) {
    .hero-content {
        flex-direction: column;
        text-align: center;
        gap: 2rem;
        padding-top: 2rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .row {
        flex-direction: column;
    }
}

/* --- CUSTOM SCROLLBAR --- */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

* {
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
}