/* Base & Reset */
:root {
    --bg-dark: hsl(225, 20%, 8%);
    --bg-panel: hsl(225, 20%, 14%, 0.6);
    --border-glass: hsl(225, 20%, 30%, 0.4);

    --text-primary: hsl(220, 15%, 95%);
    --text-secondary: hsl(220, 15%, 70%);

    --accent-gradient: linear-gradient(135deg, hsl(265, 85%, 65%), hsl(325, 85%, 60%));
    --accent-color: hsl(265, 85%, 65%);
    --accent-hover: hsl(265, 85%, 75%);

    --success-color: hsl(150, 70%, 45%);
    --danger-color: hsl(350, 70%, 55%);
    --warning-color: hsl(40, 90%, 60%);

    --font-main: 'Outfit', sans-serif;
    --border-radius: 16px;
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
    background-image:
        radial-gradient(circle at 15% 15%, hsl(265, 85%, 65%, 0.15) 0%, transparent 40%),
        radial-gradient(circle at 85% 85%, hsl(325, 85%, 60%, 0.15) 0%, transparent 40%);
    background-attachment: fixed;
}

/* Utilities */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-sm {
    font-size: 0.85rem;
}

.text-md {
    font-size: 1.1rem;
}

.op-70 {
    opacity: 0.7;
}

.mb-2 {
    margin-bottom: 0.5rem;
}

.mb-3 {
    margin-bottom: 1rem;
}

.mb-4 {
    margin-bottom: 1.5rem;
}

.mt-1 {
    margin-top: 0.25rem;
}

.mt-2 {
    margin-top: 0.5rem;
}

.mt-3 {
    margin-top: 1rem;
}

.mt-4 {
    margin-top: 1.5rem;
}

.w-100 {
    width: 100%;
}

.block {
    display: block;
}

.flex-row {
    display: flex;
    align-items: center;
}

.spread {
    justify-content: space-between;
}

.align-center {
    align-items: center;
}

/* View System */
.view {
    display: none;
    animation: fadeIn 0.4s ease-out forwards;
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.view.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Glassmorphism Panels */
.glass-panel {
    background: var(--bg-panel);
    border: 1px solid var(--border-glass);
    border-radius: var(--border-radius);
    padding: 2rem;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    transition: var(--transition);
}

.glass-panel:hover {
    border-color: var(--accent-color);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 15px rgba(138, 43, 226, 0.1);
}

/* Typography elements */
h1,
h2,
h3,
h4 {
    font-weight: 600;
    line-height: 1.2;
}

.gradient-text {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

/* Buttons */
.btn {
    font-family: var(--font-main);
    font-weight: 500;
    padding: 0.8rem 1.5rem;
    border-radius: 50px;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    font-size: 1rem;
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.4s ease-out, height 0.4s ease-out;
}

.btn:hover::after {
    width: 200%;
    padding-top: 200%;
}

.btn.lg {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

.btn:active {
    transform: scale(0.97);
}

.btn-primary {
    background: var(--accent-gradient);
    color: white;
    box-shadow: 0 4px 15px rgba(138, 43, 226, 0.3);
}

.btn-primary:hover {
    box-shadow: 0 6px 20px rgba(138, 43, 226, 0.5);
    transform: translateY(-2px);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid var(--border-glass);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: white;
}

.btn-outline {
    background: transparent;
    color: var(--accent-color);
    border: 1px solid var(--accent-color);
}

.btn-outline:hover {
    background: rgba(138, 43, 226, 0.1);
}

.btn-text {
    background: transparent;
    color: var(--text-secondary);
    padding: 0.5rem 0;
    border-radius: 0;
}

.btn-text:hover {
    color: white;
}

.btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* Navigation */
nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background: rgba(15, 15, 20, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-glass);
    position: sticky;
    top: 0;
    z-index: 50;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
}

.logo span {
    color: var(--accent-color);
}

.nav-links {
    display: flex;
    gap: 1rem;
}

.nav-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1rem;
    font-family: inherit;
    cursor: pointer;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: var(--transition);
}

.nav-btn:hover {
    color: white;
    background: rgba(255, 255, 255, 0.05);
}

.nav-btn.active {
    color: white;
    border-bottom: 2px solid var(--accent-color);
    border-radius: 0;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--accent-color);
}

/* Landing Section */
.splash-container {
    height: 80vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.splash-container h1 {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.splash-container .subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 2.5rem;
    max-width: 600px;
}

.action-buttons {
    display: flex;
    gap: 1rem;
}

/* Forms */
.form-container {
    max-width: 600px;
    margin: 2rem auto;
}

.form-desc {
    color: var(--text-secondary);
    margin-top: 0.5rem;
    margin-bottom: 2rem;
}

.input-row {
    display: flex;
    gap: 1rem;
}

.input-group {
    margin-bottom: 1.2rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    text-align: left;
}

.input-group label {
    display: block;
    margin-bottom: 0.4rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

input,
select {
    width: 100%;
    padding: 0.8rem 1rem;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-glass);
    border-radius: 8px;
    color: white;
    font-family: inherit;
    font-size: 1rem;
    transition: var(--transition);
}

input:focus,
select:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(138, 43, 226, 0.2);
}

option {
    background: var(--bg-dark);
    color: white;
}

/* Welcome Screen */
.success-panel {
    max-width: 500px;
    margin: 4rem auto;
}

.icon-success {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--success-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: bold;
    margin: 0 auto 1.5rem auto;
    box-shadow: 0 0 20px rgba(46, 204, 113, 0.4);
}

.id-card {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    padding: 1.5rem;
    margin: 1.5rem 0;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    text-align: left;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.id-card img {
    width: 80px;
    height: 80px;
    border-radius: 12px;
    object-fit: cover;
}

.id-details h3 {
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
}

/* Dashboard */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.col-span-2 {
    grid-column: span 2;
}

@media (max-width: 900px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .col-span-2 {
        grid-column: span 1;
    }

    .input-row {
        flex-direction: column;
        gap: 0;
    }
}

.stats-row {
    display: flex;
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.stat-card {
    flex: 1;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.stat-val {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.stat-val.accent {
    color: var(--accent-color);
}

.stat-val.highlight {
    color: var(--success-color);
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.qr-widget {
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.brand-grad {
    background: linear-gradient(135deg, rgba(88, 28, 135, 0.4), rgba(190, 24, 93, 0.4));
    border-color: rgba(255, 255, 255, 0.1);
}

.leaderboard-list {
    list-style: none;
    margin-top: 1rem;
}

.leaderboard-list li {
    padding: 0.8rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
}

.leaderboard-list li:last-child {
    border: none;
}

.rank {
    font-weight: 700;
    opacity: 0.5;
    width: 30px;
}

.badge {
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.1);
    margin-left: auto;
    font-weight: 600;
}

.badge.PRO {
    background: var(--accent-color);
    color: white;
}

/* Sessions */
.session-list {
    display: grid;
    gap: 1rem;
}

.session-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    padding: 1.5rem;
}

.session-card:hover {
    transform: translateX(5px);
}

.session-status {
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.4rem 0.8rem;
    border-radius: 50px;
}

.session-status.pending {
    background: rgba(243, 156, 18, 0.2);
    color: var(--warning-color);
    border: 1px solid rgba(243, 156, 18, 0.4);
}

.session-status.done {
    background: rgba(46, 204, 113, 0.2);
    color: var(--success-color);
    border: 1px solid rgba(46, 204, 113, 0.4);
}

.content-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

@media(max-width: 768px) {
    .content-grid {
        grid-template-columns: 1fr;
    }
}

.clean-list {
    list-style-position: inside;
    color: var(--text-secondary);
    margin-top: 1rem;
}

.clean-list li {
    margin-bottom: 0.5rem;
}

.resource-link {
    display: inline-block;
    padding: 0.8rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    color: white;
    text-decoration: none;
    border: 1px solid var(--border-glass);
    transition: var(--transition);
    margin-top: 0.5rem;
}

.resource-link:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--accent-color);
}

.hw-area {
    background: rgba(0, 0, 0, 0.2);
    padding: 1.5rem;
    border-radius: 12px;
}

/* Modals */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.modal-content {
    max-width: 400px;
    width: 90%;
    animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popIn {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.scanner-box {
    width: 250px;
    height: 250px;
    margin: 0 auto;
    border: 2px dashed var(--accent-color);
    border-radius: 16px;
    position: relative;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.3);
}

.scan-line {
    width: 100%;
    height: 2px;
    background: var(--success-color);
    box-shadow: 0 0 10px var(--success-color);
    position: absolute;
    top: 0;
    left: 0;
    animation: scan 2s infinite linear;
}

@keyframes scan {
    0% {
        top: 0;
    }

    50% {
        top: 100%;
    }

    100% {
        top: 0;
    }
}

/* Teacher Dashboard Feedback Panel */
.submission-item {
    background: rgba(0, 0, 0, 0.2);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.diff-flag {
    background: rgba(231, 76, 60, 0.2);
    color: var(--danger-color);
    border: 1px solid rgba(231, 76, 60, 0.4);
}

.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-glass);
    color: var(--text-secondary);
    padding: 0.5rem 1rem;
    border-radius: 50px;
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.85rem;
    font-family: inherit;
}

.tag-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-color: var(--accent-color);
    transform: scale(1.05);
}

.tag-btn.danger:hover {
    background: rgba(231, 76, 60, 0.1);
    color: var(--danger-color);
    border-color: var(--danger-color);
}

.tag-btn.active {
    background: var(--accent-gradient);
    color: white;
    border-color: transparent;
}

/* Master Control Specific */
.teacher-nav {
    display: flex;
    overflow-x: auto;
    gap: 0.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-glass);
    margin-bottom: 1.5rem;
}

.t-nav-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid transparent;
    color: var(--text-secondary);
    padding: 0.8rem 1.2rem;
    border-radius: 8px;
    cursor: pointer;
    white-space: nowrap;
    transition: var(--transition);
}

.t-nav-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.t-nav-btn.active {
    background: var(--accent-gradient);
    color: white;
    font-weight: 600;
}

.t-tab {
    animation: fadeIn 0.3s ease-out forwards;
}

.session-card-large {
    border: 1px solid var(--accent-color);
    padding: 1.5rem;
    border-radius: 12px;
    background: rgba(138, 43, 226, 0.1);
}

.table-styled {
    border-collapse: collapse;
}

.table-styled th,
.table-styled td {
    padding: 0.8rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.table-styled th {
    text-align: left;
    color: var(--text-secondary);
    font-weight: 500;
}

.py-3 {
    padding-top: 1.2rem;
    padding-bottom: 1.2rem;
}

.px-3 {
    padding-left: 1.2rem;
    padding-right: 1.2rem;
}

.border-bottom {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.flex-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.p-0 {
    padding: 0 !important;
}

.p-3 {
    padding: 1.5rem;
}

.overflow-hidden {
    overflow: hidden;
}

/* Submissions Grid */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.sub-card {
    display: flex;
    flex-direction: column;
}

.sub-img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-bottom: 1px solid var(--border-glass);
}

.btn-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

/* Students Hover */
.hover-bg {
    transition: var(--transition);
    cursor: pointer;
}

.hover-bg:hover {
    background: rgba(255, 255, 255, 0.05);
}

/* Range Slider */
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255, 255, 255, 0.2);
    height: 6px;
    border-radius: 3px;
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: var(--accent-color);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(138, 43, 226, 0.5);
}

@media (max-width: 768px) {
    .grid-2 {
        grid-template-columns: 1fr;
    }

    .teacher-nav {
        padding-bottom: 0.5rem;
    }
}