/* ============================================================
   ClassRoom - Custom Styles
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=Fraunces:ital,opsz,wght@0,9..144,400;0,9..144,700;1,9..144,400&display=swap');

:root {
    --primary:        #1a56db;
    --primary-light:  #e8f0fe;
    --primary-dark:   #1345b7;
    --accent:         #f59e0b;
    --success:        #10b981;
    --danger:         #ef4444;
    --surface:        #ffffff;
    --surface-alt:    #f8fafc;
    --border:         #e2e8f0;
    --text-main:      #0f172a;
    --text-muted:     #64748b;
    --shadow-sm:      0 1px 3px rgba(0,0,0,.08);
    --shadow-md:      0 4px 16px rgba(0,0,0,.10);
    --shadow-lg:      0 8px 30px rgba(0,0,0,.12);
    --radius:         12px;
    --radius-lg:      18px;
}

*, *::before, *::after { box-sizing: border-box; }

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background: var(--surface-alt);
    color: var(--text-main);
    min-height: 100vh;
    margin: 0;
    line-height: 1.6;
}

h1, h2, h3 {
    font-family: 'Fraunces', serif;
    letter-spacing: -.02em;
}

/* ---- Navbar ---- */
.navbar {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    height: 60px;
    display: flex;
    align-items: center;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.navbar-brand {
    font-family: 'Fraunces', serif;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ---- Cards ---- */
.card {
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: box-shadow .2s, transform .2s;
}

.card:hover { box-shadow: var(--shadow-md); }

.classroom-card {
    cursor: pointer;
    transition: transform .2s, box-shadow .2s;
}

.classroom-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.classroom-header {
    height: 90px;
    padding: 16px 20px;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.classroom-header h3 {
    color: #fff;
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0;
    text-shadow: 0 1px 3px rgba(0,0,0,.3);
}

.classroom-header span {
    color: rgba(255,255,255,.85);
    font-size: .78rem;
}

/* ---- Buttons ---- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 20px;
    border-radius: 8px;
    font-size: .875rem;
    font-weight: 600;
    font-family: 'Plus Jakarta Sans', sans-serif;
    cursor: pointer;
    border: none;
    transition: all .18s;
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary  { background: var(--primary);  color: #fff; }
.btn-primary:hover  { background: var(--primary-dark); transform: translateY(-1px); }
.btn-outline  { background: transparent; color: var(--primary); border: 1.5px solid var(--primary); }
.btn-outline:hover  { background: var(--primary-light); }
.btn-danger   { background: var(--danger); color: #fff; }
.btn-danger:hover   { background: #dc2626; }
.btn-success  { background: var(--success); color: #fff; }
.btn-ghost    { background: transparent; color: var(--text-muted); }
.btn-ghost:hover    { background: var(--surface-alt); color: var(--text-main); }
.btn-sm { padding: 6px 14px; font-size: .8rem; }
.btn-lg { padding: 12px 28px; font-size: 1rem; }

/* ---- Form ---- */
.form-group { margin-bottom: 18px; }

.form-label {
    display: block;
    font-size: .83rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .05em;
    margin-bottom: 6px;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: .9rem;
    color: var(--text-main);
    background: var(--surface);
    transition: border-color .18s, box-shadow .18s;
    outline: none;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26,86,219,.12);
}

textarea.form-control { resize: vertical; min-height: 100px; }

/* ---- Avatar ---- */
.avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700;
    font-size: .9rem;
    color: #fff;
    background: var(--primary);
    flex-shrink: 0;
}

/* ---- Badge ---- */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 99px;
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
}
.badge-blue   { background: #dbeafe; color: #1e40af; }
.badge-green  { background: #d1fae5; color: #065f46; }
.badge-amber  { background: #fef3c7; color: #92400e; }
.badge-red    { background: #fee2e2; color: #991b1b; }
.badge-gray   { background: #f1f5f9; color: #475569; }

/* ---- Upload zone ---- */
.upload-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 36px 24px;
    text-align: center;
    cursor: pointer;
    transition: all .2s;
    background: var(--surface-alt);
}
.upload-zone:hover,
.upload-zone.drag-over {
    border-color: var(--primary);
    background: var(--primary-light);
}
.upload-zone svg { color: var(--text-muted); }

/* ---- Sidebar ---- */
.sidebar {
    width: 250px;
    background: var(--surface);
    border-right: 1px solid var(--border);
    min-height: calc(100vh - 60px);
    padding: 20px 12px;
    flex-shrink: 0;
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 8px;
    color: var(--text-muted);
    font-size: .9rem;
    font-weight: 500;
    text-decoration: none;
    transition: all .15s;
    cursor: pointer;
}
.sidebar-item:hover  { background: var(--surface-alt); color: var(--text-main); }
.sidebar-item.active { background: var(--primary-light); color: var(--primary); font-weight: 700; }

/* ---- Tabs ---- */
.tab-list {
    display: flex;
    border-bottom: 2px solid var(--border);
    gap: 4px;
    margin-bottom: 24px;
}

.tab-btn {
    padding: 10px 20px;
    border: none;
    background: none;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: .88rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all .18s;
}
.tab-btn:hover  { color: var(--primary); }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }

/* ---- Task item ---- */
.task-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    transition: background .15s;
}
.task-item:last-child { border-bottom: none; }
.task-item:hover { background: var(--surface-alt); }

/* ---- Announcement ---- */
.announcement-bubble {
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 20px;
    margin-bottom: 14px;
}

/* ---- Modal ---- */
.modal-backdrop {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,.4);
    z-index: 200;
    align-items: center;
    justify-content: center;
}
.modal-backdrop.open { display: flex; }

.modal {
    background: var(--surface);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 540px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: slideUp .25s ease;
}

@keyframes slideUp {
    from { transform: translateY(30px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

.modal-header {
    padding: 22px 24px 14px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-body { padding: 24px; }
.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* ---- Alert ---- */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: .875rem;
    font-weight: 500;
    margin-bottom: 16px;
    border: 1px solid transparent;
}
.alert-success { background: #d1fae5; color: #065f46; border-color: #a7f3d0; }
.alert-error   { background: #fee2e2; color: #991b1b; border-color: #fca5a5; }
.alert-info    { background: #dbeafe; color: #1e40af; border-color: #bfdbfe; }

/* ---- Grade pill ---- */
.grade-pill {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 99px;
    font-weight: 700;
    font-size: .85rem;
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
    .sidebar { display: none; }
    .main-layout { flex-direction: column; }
}

/* ---- Util ---- */
.text-ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.divider { height: 1px; background: var(--border); margin: 16px 0; }
.spinner {
    width: 20px; height: 20px;
    border: 2px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin .7s linear infinite;
    display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }
