/* =============================================
   main.css — Project stylesheet
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&family=Geist:wght@300;400;500;600&display=swap');

/* ─── RESET ─── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ─── VARIABLES ─── */
:root {
    --bg:             #080909;
    --bg-2:           #0f1011;
    --surface:        #141517;
    --surface-2:      #1a1c1e;
    --border:         rgba(255, 255, 255, 0.06);
    --border-hover:   rgba(255, 255, 255, 0.12);
    --accent:         #d4f566;
    --accent-dim:     #b8d94e;
    --accent-glow:    rgba(212, 245, 102, 0.12);
    --teacher:        #7eb8f7;
    --teacher-glow:   rgba(126, 184, 247, 0.1);
    --text:           #efefed;
    --text-2:         #a8aab0;
    --muted:          #5a5d66;
    --danger:         #f56565;
    --danger-bg:      rgba(245, 101, 101, 0.08);
    --danger-border:  rgba(245, 101, 101, 0.2);
    --radius-sm:      8px;
    --radius:         12px;
    --radius-lg:      18px;
    --radius-xl:      24px;
    --nav-h:          62px;
    --font-serif:     'Instrument Serif', serif;
    --font-sans:      'Geist', sans-serif;
}

/* ─── BASE ─── */
html { height: 100%; -webkit-font-smoothing: antialiased; }

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-sans);
    font-weight: 400;
    font-size: 15px;
    line-height: 1.6;
    min-height: 100vh;
}

a { color: inherit; text-decoration: none; }

/* ─── TYPOGRAPHY ─── */
.serif        { font-family: var(--font-serif); }
.text-muted   { color: var(--text-2); }
.text-accent  { color: var(--accent); }
.text-teacher { color: var(--teacher); }
.text-danger  { color: var(--danger); }
.text-sm      { font-size: 0.82rem; }
.text-xs      { font-size: 0.72rem; }
.uppercase    { text-transform: uppercase; letter-spacing: 0.07em; }
.font-medium  { font-weight: 500; }
.font-semibold{ font-weight: 600; }

/* ─── LAYOUT ─── */
.container {
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 32px;
}

.page-content {
    padding-top: 52px;
    padding-bottom: 80px;
}

.grid-2    { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid-3    { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.col-full  { grid-column: 1 / -1; }

.flex         { display: flex; }
.flex-center  { display: flex; align-items: center; justify-content: center; }
.items-center { align-items: center; }
.gap-2  { gap: 8px; }
.gap-3  { gap: 12px; }
.gap-4  { gap: 16px; }

.mb-1  { margin-bottom: 4px; }
.mb-2  { margin-bottom: 8px; }
.mb-3  { margin-bottom: 12px; }
.mb-4  { margin-bottom: 16px; }
.mb-6  { margin-bottom: 24px; }
.mb-8  { margin-bottom: 32px; }
.mb-10 { margin-bottom: 40px; }
.mb-12 { margin-bottom: 48px; }

/* ─── NAV ─── */
nav {
    position: sticky;
    top: 0;
    z-index: 100;
    height: var(--nav-h);
    background: rgba(8, 9, 9, 0.8);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 32px;
    gap: 14px;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    flex-shrink: 0;
}

.nav-logo-mark {
    width: 28px;
    height: 28px;
    background: var(--accent);
    border-radius: 6px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
}

.nav-logo-text {
    font-family: var(--font-serif);
    font-size: 1.05rem;
    color: var(--text);
    letter-spacing: -0.01em;
}

.nav-spacer { flex: 1; }

.nav-badge {
    font-size: 0.7rem;
    font-weight: 500;
    padding: 3px 9px;
    border-radius: 20px;
    letter-spacing: 0.04em;
    flex-shrink: 0;
}

.nav-badge.teacher {
    background: var(--teacher-glow);
    color: var(--teacher);
    border: 1px solid rgba(126, 184, 247, 0.18);
}

.nav-badge.student {
    background: var(--accent-glow);
    color: var(--accent);
    border: 1px solid rgba(212, 245, 102, 0.18);
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-name {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text);
}

/* ─── AVATAR ─── */
.avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--surface-2);
    border: 1px solid var(--border);
    display: grid;
    place-items: center;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-2);
    letter-spacing: 0.03em;
    flex-shrink: 0;
}

/* ─── BUTTONS ─── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-family: var(--font-sans);
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    border: 1px solid transparent;
    transition: background 0.15s, border-color 0.15s, color 0.15s,
                transform 0.12s, box-shadow 0.15s;
    white-space: nowrap;
    line-height: 1;
}

.btn:active { transform: scale(0.98) !important; }

.btn-primary {
    background: var(--accent);
    color: #080909;
    border-color: var(--accent);
}
.btn-primary:hover {
    background: var(--accent-dim);
    border-color: var(--accent-dim);
    transform: translateY(-1px);
    box-shadow: 0 6px 24px rgba(212, 245, 102, 0.2);
}

.btn-ghost {
    background: transparent;
    color: var(--text-2);
    border-color: var(--border);
}
.btn-ghost:hover {
    border-color: var(--border-hover);
    color: var(--text);
    background: rgba(255, 255, 255, 0.03);
}

.btn-green-soft {
    background: var(--accent-glow);
    color: var(--accent);
    border-color: rgba(212, 245, 102, 0.18);
}
.btn-green-soft:hover { background: rgba(212, 245, 102, 0.18); }

.btn-blue-soft {
    background: var(--teacher-glow);
    color: var(--teacher);
    border-color: rgba(126, 184, 247, 0.18);
}
.btn-blue-soft:hover { background: rgba(126, 184, 247, 0.18); }

.btn-sm   { padding: 7px 14px; font-size: 0.78rem; }
.btn-lg   { padding: 14px 28px; font-size: 0.95rem; }
.btn-full { width: 100%; }

/* ─── CARDS / PANELS ─── */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
}

.panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px;
    transition: border-color 0.2s;
}
.panel:hover { border-color: var(--border-hover); }

.panel-title {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.panel-desc {
    font-size: 0.8rem;
    color: var(--text-2);
    line-height: 1.6;
    margin-bottom: 16px;
}

.panel-icon {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
}
.panel-icon.green  { background: rgba(212, 245, 102, 0.1); }
.panel-icon.blue   { background: rgba(126, 184, 247, 0.1); }
.panel-icon.purple { background: rgba(180, 140, 255, 0.1); }
.panel-icon.orange { background: rgba(255, 165, 80, 0.1); }
.panel-icon.red    { background: rgba(245, 101, 101, 0.1); }

/* ─── STAT CARDS ─── */
.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 20px;
}
.stat-label {
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.07em;
    margin-bottom: 6px;
}
.stat-value {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text);
}

/* ─── SECTION LABEL ─── */
.section-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 12px;
}

/* ─── DIVIDER ─── */
.divider {
    display: flex;
    align-items: center;
    gap: 14px;
    color: var(--muted);
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* ─── ALERTS ─── */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.83rem;
    line-height: 1.5;
}
.alert svg { flex-shrink: 0; margin-top: 1px; }
.alert-error {
    background: var(--danger-bg);
    border: 1px solid var(--danger-border);
    color: #f8a0a0;
}
.alert-success {
    background: rgba(212, 245, 102, 0.07);
    border: 1px solid rgba(212, 245, 102, 0.18);
    color: var(--accent);
}

/* ─── ROLE HIGHLIGHT ─── */
.role-highlight {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 22px;
    display: flex;
    align-items: center;
    gap: 14px;
}
.role-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}
.role-dot.teacher {
    background: var(--teacher);
    box-shadow: 0 0 8px rgba(126, 184, 247, 0.6);
}
.role-dot.student {
    background: var(--accent);
    box-shadow: 0 0 8px rgba(212, 245, 102, 0.6);
}
.role-info strong { font-size: 0.88rem; font-weight: 600; }
.role-info span   { font-size: 0.8rem; color: var(--text-2); margin-left: 8px; }

/* ─── QUICK LIST ─── */
.quick-list { list-style: none; }
.quick-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 0;
    font-size: 0.83rem;
    color: var(--text-2);
    border-bottom: 1px solid var(--border);
}
.quick-list li:last-child { border-bottom: none; }
.quick-list li::before {
    content: '';
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--muted);
    flex-shrink: 0;
}

/* ─── SESSION BAR ─── */
.session-bar {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 18px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.78rem;
    color: var(--text-2);
}
.session-bar svg { flex-shrink: 0; }
.session-bar a {
    text-decoration: underline;
    text-underline-offset: 3px;
    color: inherit;
}

/* ─── FORMS ─── */
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-label {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-2);
}
.form-input {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    font-family: var(--font-sans);
    font-size: 0.88rem;
    color: var(--text);
    outline: none;
    width: 100%;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.form-input:focus {
    border-color: rgba(212, 245, 102, 0.35);
    box-shadow: 0 0 0 3px rgba(212, 245, 102, 0.05);
}
.form-input::placeholder { color: var(--muted); }

/* ─── TABLES ─── */
.table-wrap {
    overflow-x: auto;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}
table { width: 100%; border-collapse: collapse; font-size: 0.83rem; }
thead { background: var(--surface-2); }
thead th {
    padding: 11px 16px;
    text-align: left;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.07em;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
tbody tr {
    border-bottom: 1px solid var(--border);
    transition: background 0.12s;
}
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: rgba(255, 255, 255, 0.02); }
tbody td { padding: 11px 16px; color: var(--text); vertical-align: middle; }

/* ─── ANIMATIONS ─── */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(18px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes rise {
    from { opacity: 0; transform: translateY(28px) scale(0.99); }
    to   { opacity: 1; transform: translateY(0)   scale(1); }
}
@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.4; }
}

.anim-rise    { animation: rise    0.55s cubic-bezier(0.22, 1, 0.36, 1) both; }
.anim-fade-up { animation: fadeUp  0.5s  cubic-bezier(0.22, 1, 0.36, 1) both; }
.anim-fade-in { animation: fadeIn  0.4s  ease both; }

.delay-1 { animation-delay: 0.07s; }
.delay-2 { animation-delay: 0.14s; }
.delay-3 { animation-delay: 0.21s; }
.delay-4 { animation-delay: 0.28s; }
.delay-5 { animation-delay: 0.35s; }

/* ─── RESPONSIVE ─── */
@media (max-width: 768px) {
    nav { padding: 0 16px; }
    .container { padding: 0 16px; }
    .page-content { padding-top: 32px; padding-bottom: 60px; }
    .grid-2, .grid-3 { grid-template-columns: 1fr; }
    .nav-name { display: none; }
}
@media (max-width: 480px) {
    .btn-lg { padding: 12px 22px; }
}

/* ─── SIDEBAR ─── */
#sidebar {
    position: fixed;
    top: calc(var(--nav-h) + 16px);
    left: 12px;
    width: 44px;
    max-height: calc(100vh - var(--nav-h) - 32px);
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 8px 6px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: width 0.2s cubic-bezier(0.4,0,0.2,1);
    z-index: 40;
}

#sidebar:hover {
    width: 160px;
}

.sidebar-label {
    font-size: 0.62rem;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 2px 6px 6px;
    white-space: nowrap;
    overflow: hidden;
    opacity: 0;
    height: 0;
    transition: opacity 0.15s, height 0.2s;
}

#sidebar:hover .sidebar-label {
    opacity: 1;
    height: 20px;
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 6px;
    border-radius: 7px;
    text-decoration: none;
    color: var(--text-2);
    font-size: 0.8rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    transition: background 0.15s, color 0.15s;
    min-width: 0;
}

.sidebar-item:hover {
    background: rgba(255,255,255,0.05);
    color: var(--text);
}

.sidebar-item.active {
    background: var(--accent-glow);
    color: var(--accent);
}

.sidebar-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    display: grid;
    place-items: center;
}

.sidebar-name {
    opacity: 0;
    transition: opacity 0.15s 0.05s;
    overflow: hidden;
    text-overflow: ellipsis;
}

#sidebar:hover .sidebar-name {
    opacity: 1;
}

.sidebar-home {
    margin-top: 4px;
    border-top: 1px solid var(--border);
    padding-top: 10px;
    color: var(--muted);
}

/* with-sidebar — saturs aizņem pilnu platumu, sidebar ir fixed */
.with-sidebar {
    display: block;
}

.sidebar-content {
    width: 100%;
}

@media (max-width: 768px) {
    #sidebar { display: none; }
}

/* ─── THEMES ─── */

/* Default: dark-green (base :root already defines this) */

[data-theme="dark-blue"] {
    --accent:       #7eb8f7;
    --accent-dim:   #5a9de0;
    --accent-glow:  rgba(126, 184, 247, 0.12);
    --student:      #7eb8f7;
}

[data-theme="dark-orange"] {
    --accent:       #ffa550;
    --accent-dim:   #e08a30;
    --accent-glow:  rgba(255, 165, 80, 0.12);
    --student:      #ffa550;
}

[data-theme="dark-purple"] {
    --accent:       #b48cff;
    --accent-dim:   #9a6fee;
    --accent-glow:  rgba(180, 140, 255, 0.12);
    --student:      #b48cff;
}

[data-theme="light"] {
    --bg:           #f4f5f6;
    --bg-2:         #ecedef;
    --surface:      #ffffff;
    --surface-2:    #f0f1f2;
    --border:       rgba(0, 0, 0, 0.08);
    --border-hover: rgba(0, 0, 0, 0.16);
    --accent:       #2a9d5c;
    --accent-dim:   #1f7d46;
    --accent-glow:  rgba(42, 157, 92, 0.1);
    --teacher:      #2563eb;
    --teacher-glow: rgba(37, 99, 235, 0.1);
    --text:         #111214;
    --text-2:       #4a4d54;
    --muted:        #8a8d96;
    --student:      #2a9d5c;
    --danger:       #dc2626;
    --danger-bg:    rgba(220, 38, 38, 0.08);
    --danger-border:rgba(220, 38, 38, 0.2);
}

[data-theme="light"] body {
    background: var(--bg);
}

[data-theme="light"] nav {
    background: rgba(244, 245, 246, 0.85);
}