/* =============================================
   StudyHub 2.0 — Warm Academic Theme
   Completely unique design language
   ============================================= */

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

:root {
    --primary: #f97316;
    --primary-dark: #ea580c;
    --primary-light: #fdba74;
    --primary-bg: rgba(249,115,22,0.08);
    --violet: #8b5cf6;
    --violet-bg: rgba(139,92,246,0.08);
    --cyan: #06b6d4;
    --cyan-bg: rgba(6,182,212,0.08);
    --emerald: #10b981;
    --emerald-bg: rgba(16,185,129,0.08);
    --rose: #f43f5e;
    --rose-bg: rgba(244,63,94,0.08);
    --amber: #f59e0b;
    --dark: #1e293b;
    --dark-secondary: #475569;
    --gray: #94a3b8;
    --border: #e2e8f0;
    --bg: #faf8f5;
    --bg-warm: #fef7ee;
    --white: #ffffff;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.06);
    --shadow: 0 4px 16px rgba(0,0,0,0.06);
    --shadow-md: 0 8px 30px rgba(0,0,0,0.08);
    --shadow-lg: 0 20px 50px rgba(0,0,0,0.1);
    --shadow-orange: 0 8px 30px rgba(249,115,22,0.2);
    --r: 14px;
    --r-sm: 10px;
    --r-lg: 20px;
    --r-xl: 24px;
    --t: all 0.25s cubic-bezier(0.4,0,0.2,1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background: var(--bg);
    color: var(--dark);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* ===== AUTH PAGES — Split Layout ===== */
.auth-page {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr 1fr;
}

.auth-showcase {
    background: linear-gradient(145deg, #f97316, #ea580c, #c2410c);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 60px;
    position: relative;
    overflow: hidden;
}

.auth-showcase::before {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    background: rgba(255,255,255,0.08);
    border-radius: 50%;
    top: -100px;
    right: -100px;
}

.auth-showcase::after {
    content: '';
    position: absolute;
    width: 300px;
    height: 300px;
    background: rgba(255,255,255,0.05);
    border-radius: 50%;
    bottom: -80px;
    left: -80px;
}

.auth-showcase .showcase-content {
    position: relative;
    z-index: 1;
    text-align: center;
    color: white;
}

.showcase-icon {
    width: 90px;
    height: 90px;
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(10px);
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    margin: 0 auto 28px;
    border: 1px solid rgba(255,255,255,0.2);
}

.showcase-content h1 {
    font-size: 36px;
    font-weight: 800;
    margin-bottom: 12px;
    letter-spacing: -0.5px;
}

.showcase-content p {
    font-size: 16px;
    opacity: 0.85;
    line-height: 1.6;
    max-width: 360px;
}

.showcase-features {
    margin-top: 40px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.showcase-features .feat {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    opacity: 0.9;
}

.showcase-features .feat i {
    width: 36px;
    height: 36px;
    background: rgba(255,255,255,0.15);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.auth-form-side {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    background: var(--white);
}

.auth-form-wrapper {
    width: 100%;
    max-width: 400px;
    animation: authSlide 0.5s ease-out;
}

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

.auth-form-wrapper h2 {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 4px;
    letter-spacing: -0.5px;
}

.auth-form-wrapper .subtitle {
    color: var(--dark-secondary);
    font-size: 14px;
    margin-bottom: 32px;
}

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

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 6px;
}

.input-wrap {
    position: relative;
}

.input-wrap input {
    width: 100%;
    border: 2px solid var(--border);
    border-radius: var(--r-sm);
    padding: 13px 16px 13px 44px;
    font-size: 14px;
    font-family: inherit;
    transition: var(--t);
    background: var(--bg);
    color: var(--dark);
}

.input-wrap input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-bg);
    background: var(--white);
}

.input-wrap .icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray);
    font-size: 15px;
    transition: var(--t);
}

.input-wrap input:focus + .icon { color: var(--primary); }

.btn-auth {
    width: 100%;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border: none;
    border-radius: var(--r-sm);
    padding: 14px;
    font-size: 15px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: var(--t);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 8px;
}

.btn-auth:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-orange);
}

.auth-switch {
    text-align: center;
    margin-top: 24px;
    font-size: 14px;
    color: var(--dark-secondary);
}

.auth-switch a {
    color: var(--primary);
    font-weight: 700;
    text-decoration: none;
}

.auth-switch a:hover { text-decoration: underline; }

/* ===== SIDEBAR — Light Theme ===== */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 260px;
    height: 100vh;
    background: var(--white);
    border-right: 1px solid var(--border);
    padding: 24px 16px;
    z-index: 1000;
    overflow-y: auto;
    transition: var(--t);
    display: flex;
    flex-direction: column;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 8px 24px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 20px;
}

.sidebar-brand-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: white;
    flex-shrink: 0;
}

.sidebar-brand h4 {
    font-weight: 800;
    font-size: 18px;
    margin: 0;
    letter-spacing: -0.3px;
    color: var(--dark);
}

.sidebar-brand small {
    color: var(--gray);
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.nav-group-label {
    color: var(--gray);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    padding: 0 10px;
    margin: 18px 0 8px;
}

.sidebar .nav-link {
    color: var(--dark-secondary);
    padding: 10px 12px;
    border-radius: var(--r-sm);
    margin-bottom: 2px;
    font-size: 13px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: var(--t);
    text-decoration: none;
}

.sidebar .nav-link i { width: 20px; text-align: center; font-size: 15px; color: var(--gray); transition: var(--t); }

.sidebar .nav-link:hover {
    color: var(--primary);
    background: var(--primary-bg);
}

.sidebar .nav-link:hover i { color: var(--primary); }

.sidebar .nav-link.active {
    color: var(--primary);
    background: var(--primary-bg);
    font-weight: 700;
}

.sidebar .nav-link.active i { color: var(--primary); }

.nav-badge {
    margin-left: auto;
    background: var(--primary);
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 50px;
    min-width: 20px;
    text-align: center;
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.sidebar-user-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-radius: var(--r-sm);
    text-decoration: none;
    transition: var(--t);
}

.sidebar-user-card:hover { background: var(--bg); }

.avatar {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    color: white;
    flex-shrink: 0;
}

.avatar-lg { width: 80px; height: 80px; border-radius: 20px; font-size: 32px; }

.sidebar-user-card .uname { font-size: 13px; font-weight: 600; color: var(--dark); }
.sidebar-user-card .uemail { font-size: 10px; color: var(--gray); }

.btn-logout {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--gray);
    padding: 10px 12px;
    border-radius: var(--r-sm);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: var(--t);
    margin-top: 4px;
}

.btn-logout:hover { color: var(--rose); background: var(--rose-bg); }

/* ===== MAIN ===== */
.main { margin-left: 260px; padding: 28px 32px; min-height: 100vh; }

.page-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
    flex-wrap: wrap;
    gap: 12px;
}

.page-top h1 {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.3px;
}

.page-top h1 span { color: var(--primary); }

/* ===== STAT CARDS ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.stat-box {
    background: var(--white);
    border-radius: var(--r);
    padding: 22px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    transition: var(--t);
    position: relative;
    overflow: hidden;
}

.stat-box:hover { transform: translateY(-2px); box-shadow: var(--shadow); }

.stat-box .stat-ic {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    margin-bottom: 14px;
}

.stat-box .stat-num { font-size: 24px; font-weight: 800; letter-spacing: -0.5px; }
.stat-box .stat-lbl { font-size: 12px; font-weight: 500; color: var(--gray); margin-top: 2px; }

/* ===== CARD ===== */
.card-box {
    background: var(--white);
    border-radius: var(--r);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    overflow: hidden;
}

.card-top {
    padding: 18px 22px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-top h5 {
    font-weight: 700;
    font-size: 16px;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-top h5 i { color: var(--primary); font-size: 15px; }

.card-inner { padding: 22px; }

/* ===== NOTE CARDS ===== */
.notes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}

.ncard {
    background: var(--white);
    border-radius: var(--r);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    transition: var(--t);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.ncard:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-light);
}

.ncard-head {
    padding: 18px 18px 14px;
    display: flex;
    gap: 12px;
}

.file-ic {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: white;
    flex-shrink: 0;
}

.ncard-meta { flex: 1; min-width: 0; }

.ncard-title {
    font-weight: 700;
    font-size: 14px;
    margin: 0 0 3px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ncard-title a { color: inherit; text-decoration: none; transition: var(--t); }
.ncard-title a:hover { color: var(--primary); }

.ncard-by { font-size: 11px; color: var(--gray); }

.ncard-body {
    padding: 0 18px 14px;
    flex: 1;
}

.ncard-desc {
    font-size: 12px;
    color: var(--dark-secondary);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 10px;
}

.tags { display: flex; flex-wrap: wrap; gap: 5px; }

.tag {
    padding: 3px 9px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.2px;
}

.tag-sub { background: var(--primary-bg); color: var(--primary); }
.tag-sem { background: var(--violet-bg); color: var(--violet); }
.tag-cat { background: var(--emerald-bg); color: var(--emerald); }
.tag-type { background: var(--cyan-bg); color: var(--cyan); }

.ncard-foot {
    padding: 12px 18px;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 11px;
    color: var(--gray);
}

.ncard-stats { display: flex; align-items: center; gap: 12px; }
.ncard-stats span { display: flex; align-items: center; gap: 3px; }

.stars-row { display: inline-flex; gap: 1px; }
.star-filled { color: var(--amber); }
.star-empty { color: #e2e8f0; }

/* ===== BUTTONS ===== */
.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border: none;
    border-radius: var(--r-sm);
    padding: 10px 20px;
    font-size: 13px;
    font-weight: 700;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    cursor: pointer;
    transition: var(--t);
    text-decoration: none;
}

.btn-primary:hover { transform: translateY(-1px); box-shadow: var(--shadow-orange); color: white; }

.btn-ghost {
    background: var(--bg);
    color: var(--dark-secondary);
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    padding: 10px 18px;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: var(--t);
    text-decoration: none;
}

.btn-ghost:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-bg); }

.btn-sm { padding: 7px 12px; font-size: 12px; }

.btn-icon-edit {
    background: var(--cyan-bg);
    color: var(--cyan);
    border: none;
    border-radius: 8px;
    padding: 7px 12px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--t);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.btn-icon-edit:hover { background: var(--cyan); color: white; }

.btn-icon-del {
    background: var(--rose-bg);
    color: var(--rose);
    border: none;
    border-radius: 8px;
    padding: 7px 12px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--t);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.btn-icon-del:hover { background: var(--rose); color: white; }

.btn-download {
    background: linear-gradient(135deg, var(--emerald), #059669);
    color: white;
    border: none;
    border-radius: var(--r-sm);
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 700;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: var(--t);
    text-decoration: none;
}

.btn-download:hover { transform: translateY(-2px); box-shadow: 0 8px 25px rgba(16,185,129,0.3); color: white; }

.btn-bookmark {
    background: var(--violet-bg);
    color: var(--violet);
    border: none;
    border-radius: var(--r-sm);
    padding: 10px 18px;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: var(--t);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
}

.btn-bookmark:hover { background: var(--violet); color: white; }
.btn-bookmark.active { background: var(--violet); color: white; }

.action-btns { display: flex; gap: 6px; }

/* ===== FORMS ===== */
.form-box .f-label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 6px;
    letter-spacing: 0.2px;
}

.form-box .f-input,
.form-box .f-select,
.form-box .f-textarea {
    width: 100%;
    border: 2px solid var(--border);
    border-radius: var(--r-sm);
    padding: 11px 14px;
    font-size: 13px;
    font-family: inherit;
    transition: var(--t);
    background: var(--bg);
    color: var(--dark);
}

.form-box .f-input:focus,
.form-box .f-select:focus,
.form-box .f-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-bg);
    background: var(--white);
}

.form-box .f-textarea { min-height: 90px; resize: vertical; }

/* ===== UPLOAD ZONE ===== */
.drop-zone {
    border: 2px dashed var(--border);
    border-radius: var(--r);
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    position: relative;
    background: var(--bg);
    transition: var(--t);
}

.drop-zone:hover, .drop-zone.over {
    border-color: var(--primary);
    background: var(--bg-warm);
}

.drop-zone .dz-icon { font-size: 36px; color: var(--primary-light); margin-bottom: 10px; }
.drop-zone h5 { font-size: 15px; font-weight: 700; margin-bottom: 4px; }
.drop-zone p { font-size: 12px; color: var(--gray); }
.drop-zone input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

.file-selected {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: var(--primary-bg);
    border-radius: var(--r-sm);
    margin-top: 12px;
    border: 1px solid var(--primary-light);
}

.file-selected strong { font-size: 13px; }
.file-selected small { font-size: 11px; color: var(--gray); }

/* ===== ALERTS ===== */
.alert-box {
    border-radius: var(--r-sm);
    padding: 12px 16px;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

.alert-ok { background: var(--emerald-bg); color: var(--emerald); }
.alert-err { background: var(--rose-bg); color: var(--rose); }

/* ===== TABLE ===== */
.tbl {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.tbl thead th {
    background: var(--bg);
    padding: 10px 16px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--gray);
    border-bottom: 1px solid var(--border);
}

.tbl thead th:first-child { border-radius: var(--r-sm) 0 0 var(--r-sm); }
.tbl thead th:last-child { border-radius: 0 var(--r-sm) var(--r-sm) 0; }

.tbl tbody tr { transition: var(--t); }
.tbl tbody tr:hover { background: var(--bg-warm); }

.tbl tbody td {
    padding: 12px 16px;
    font-size: 13px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

/* ===== VIEW NOTE ===== */
.detail-hero {
    background: linear-gradient(135deg, var(--bg-warm), var(--bg));
    border-radius: var(--r-lg);
    border: 1px solid var(--border);
    padding: 28px;
    margin-bottom: 20px;
}

.detail-hero .dh-top {
    display: flex;
    gap: 18px;
    align-items: flex-start;
    margin-bottom: 18px;
}

.detail-hero .dh-title { font-size: 22px; font-weight: 800; letter-spacing: -0.3px; margin-bottom: 8px; }

.detail-hero .dh-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 13px;
    color: var(--dark-secondary);
}

.detail-hero .dh-meta span { display: flex; align-items: center; gap: 5px; }
.detail-hero .dh-meta i { color: var(--gray); }

.file-box {
    background: var(--white);
    border-radius: var(--r);
    border: 1px solid var(--border);
    padding: 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.file-box .fb-info { display: flex; align-items: center; gap: 12px; }

/* ===== COMMENTS ===== */
.comment-form textarea {
    width: 100%;
    border: 2px solid var(--border);
    border-radius: var(--r-sm);
    padding: 12px 14px;
    font-size: 13px;
    font-family: inherit;
    resize: vertical;
    min-height: 80px;
    transition: var(--t);
    background: var(--bg);
}

.comment-form textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-bg);
    background: var(--white);
}

.comment-item {
    display: flex;
    gap: 12px;
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
}

.comment-item:last-child { border-bottom: none; }

.comment-body { flex: 1; }

.comment-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.comment-header strong { font-size: 13px; }
.comment-header .ctime { font-size: 11px; color: var(--gray); }

.comment-text { font-size: 13px; color: var(--dark-secondary); line-height: 1.6; }

.reply-toggle {
    font-size: 12px;
    color: var(--primary);
    cursor: pointer;
    font-weight: 600;
    margin-top: 6px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    font-family: inherit;
}

.reply-toggle:hover { text-decoration: underline; }

.replies { margin-left: 50px; margin-top: 4px; }

.reply-form {
    margin-top: 8px;
    display: none;
}

.reply-form.show { display: block; }

.reply-form textarea {
    width: 100%;
    border: 2px solid var(--border);
    border-radius: var(--r-sm);
    padding: 10px 12px;
    font-size: 12px;
    font-family: inherit;
    resize: none;
    min-height: 60px;
    background: var(--bg);
    transition: var(--t);
}

.reply-form textarea:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--white);
}

/* ===== RATING STARS (Interactive) ===== */
.rate-stars { display: flex; gap: 6px; }
.rate-stars i {
    font-size: 26px;
    cursor: pointer;
    color: #e2e8f0;
    transition: var(--t);
}
.rate-stars i.lit { color: var(--amber); }
.rate-stars i:hover { transform: scale(1.15); }

.review-card {
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
}

.review-card:last-child { border-bottom: none; }

/* ===== SEARCH ===== */
.search-wrap {
    position: relative;
    max-width: 100%;
}

.search-wrap input {
    width: 100%;
    border: 2px solid var(--border);
    border-radius: 50px;
    padding: 13px 20px 13px 48px;
    font-size: 14px;
    font-family: inherit;
    transition: var(--t);
    background: var(--white);
}

.search-wrap input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-bg);
}

.search-wrap .s-icon {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray);
    font-size: 16px;
}

/* ===== EMPTY STATE ===== */
.empty {
    text-align: center;
    padding: 50px 20px;
}

.empty i { font-size: 48px; color: var(--border); margin-bottom: 14px; }
.empty h4 { font-weight: 700; font-size: 16px; margin-bottom: 4px; }
.empty p { color: var(--gray); font-size: 13px; }

/* ===== PROFILE ===== */
.profile-hero {
    text-align: center;
    padding: 32px;
}

/* ===== MODAL ===== */
.modal-content { border: none; border-radius: var(--r); box-shadow: var(--shadow-lg); }
.modal-header { border-bottom: 1px solid var(--border); padding: 16px 20px; }
.modal-body { padding: 20px; }
.modal-footer { border-top: 1px solid var(--border); padding: 14px 20px; }

/* ===== ANIMATIONS ===== */
.fade-up { animation: fadeUp 0.4s ease-out both; }

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

.d1 { animation-delay: .05s; }
.d2 { animation-delay: .1s; }
.d3 { animation-delay: .15s; }
.d4 { animation-delay: .2s; }

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .notes-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
}

@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); box-shadow: var(--shadow-lg); }
    .sidebar.open { transform: translateX(0); }
    .main { margin-left: 0; padding: 20px 16px; }
    .mob-toggle { display: flex !important; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .auth-page { grid-template-columns: 1fr; }
    .auth-showcase { display: none; }
    .notes-grid { grid-template-columns: 1fr; }
}

.mob-toggle {
    display: none;
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 1001;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 10px;
    width: 40px;
    height: 40px;
    font-size: 16px;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-orange);
    cursor: pointer;
}

.overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.3);
    z-index: 999;
}

.overlay.show { display: block; }

::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* =============================================
   PUBLIC PAGES — Landing, Browse, Navbar, Footer
   ============================================= */

/* ===== PUBLIC NAVBAR ===== */
.pub-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 999;
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    padding: 0 32px;
    height: 64px;
}

.pub-nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    height: 100%;
    gap: 32px;
}

.pub-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    flex-shrink: 0;
}

.pub-brand-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: white;
}

.pub-brand span {
    font-size: 18px;
    font-weight: 800;
    color: var(--dark);
    letter-spacing: -0.3px;
}

.pub-links {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1;
}

.pub-link {
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
    color: var(--dark-secondary);
    text-decoration: none;
    border-radius: 8px;
    transition: var(--t);
}

.pub-link:hover, .pub-link.active { color: var(--primary); background: var(--primary-bg); }

.pub-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.pub-btn-ghost {
    padding: 9px 18px;
    font-size: 13px;
    font-weight: 600;
    color: var(--dark-secondary);
    border: 1.5px solid var(--border);
    border-radius: 8px;
    text-decoration: none;
    transition: var(--t);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: inherit;
    background: transparent;
    cursor: pointer;
}

.pub-btn-ghost:hover { border-color: var(--primary); color: var(--primary); }

.pub-btn-primary {
    padding: 9px 18px;
    font-size: 13px;
    font-weight: 700;
    color: white;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border: none;
    border-radius: 8px;
    text-decoration: none;
    transition: var(--t);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: inherit;
    cursor: pointer;
}

.pub-btn-primary:hover { transform: translateY(-1px); box-shadow: var(--shadow-orange); color: white; }

.pub-hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.pub-hamburger span {
    width: 22px;
    height: 2px;
    background: var(--dark);
    border-radius: 2px;
    transition: var(--t);
}

/* ===== HERO ===== */
.hero {
    min-height: 580px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 120px 32px 60px;
    position: relative;
    overflow: hidden;
    background: var(--white);
}

.hero-bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(249,115,22,0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 50%, rgba(139,92,246,0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 100%, rgba(6,182,212,0.05) 0%, transparent 50%);
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 720px;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 16px;
    background: var(--primary-bg);
    color: var(--primary);
    border-radius: 50px;
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 20px;
    border: 1px solid rgba(249,115,22,0.15);
}

.hero h1 {
    font-size: 48px;
    font-weight: 900;
    line-height: 1.1;
    letter-spacing: -1px;
    margin-bottom: 18px;
    color: var(--dark);
}

.hero h1 span {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-sub {
    font-size: 16px;
    color: var(--dark-secondary);
    line-height: 1.6;
    max-width: 540px;
    margin: 0 auto 28px;
}

.hero-search {
    max-width: 520px;
    margin: 0 auto 24px;
}

.hero-search form {
    display: flex;
    align-items: center;
    background: var(--white);
    border: 2px solid var(--border);
    border-radius: 50px;
    padding: 6px 6px 6px 20px;
    box-shadow: var(--shadow);
    transition: var(--t);
}

.hero-search form:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-bg), var(--shadow);
}

.hero-search i { color: var(--gray); font-size: 16px; margin-right: 12px; flex-shrink: 0; }

.hero-search input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 14px;
    font-family: inherit;
    color: var(--dark);
    background: transparent;
    min-width: 0;
}

.hero-search button {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border: none;
    border-radius: 50px;
    padding: 10px 24px;
    font-size: 13px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: var(--t);
    flex-shrink: 0;
}

.hero-search button:hover { box-shadow: var(--shadow-orange); }

.hero-btns {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

/* ===== STATS BAR ===== */
.stats-bar {
    background: var(--dark);
    padding: 28px 32px;
}

.stats-bar-inner {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sbar-item { text-align: center; flex: 1; }
.sbar-num { font-size: 28px; font-weight: 900; color: white; letter-spacing: -0.5px; }
.sbar-lbl { font-size: 12px; font-weight: 500; color: rgba(255,255,255,0.5); margin-top: 2px; }
.sbar-divider { width: 1px; height: 40px; background: rgba(255,255,255,0.1); }

/* ===== PUBLIC SECTIONS ===== */
.pub-section { padding: 60px 32px; }
.pub-container { max-width: 1200px; margin: 0 auto; }

.section-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    margin-bottom: 28px;
    flex-wrap: wrap;
    gap: 12px;
}

.section-title { font-size: 26px; font-weight: 800; letter-spacing: -0.3px; margin-bottom: 4px; }
.section-sub { font-size: 14px; color: var(--dark-secondary); }

/* ===== SUBJECT CARDS ===== */
.subjects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 14px;
}

.subject-card {
    background: var(--white);
    border-radius: var(--r);
    border: 1px solid var(--border);
    padding: 20px;
    text-decoration: none;
    text-align: center;
    transition: var(--t);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.subject-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--primary-light); }

.subj-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    margin-bottom: 12px;
}

.subject-card h6 { font-weight: 700; font-size: 14px; color: var(--dark); margin-bottom: 2px; }
.subject-card span { font-size: 12px; color: var(--gray); }

/* ===== HOW IT WORKS ===== */
.hiw-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.hiw-card {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: var(--r-lg);
    padding: 32px 24px;
    text-align: center;
    position: relative;
}

.hiw-num {
    position: absolute;
    top: 16px;
    right: 18px;
    font-size: 42px;
    font-weight: 900;
    color: rgba(255,255,255,0.05);
}

.hiw-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: white;
    margin: 0 auto 18px;
}

.hiw-card h5 { color: white; font-weight: 700; font-size: 16px; margin-bottom: 8px; }
.hiw-card p { color: rgba(255,255,255,0.6); font-size: 13px; line-height: 1.6; }

/* ===== CTA ===== */
.cta-box {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: var(--r-xl);
    padding: 48px 40px;
    text-align: center;
}

.cta-box h2 { color: white; font-size: 28px; font-weight: 800; margin-bottom: 10px; }
.cta-box p { color: rgba(255,255,255,0.8); font-size: 15px; margin-bottom: 24px; }
.cta-box .pub-btn-ghost { color: white; border-color: rgba(255,255,255,0.3); }
.cta-box .pub-btn-ghost:hover { background: rgba(255,255,255,0.1); border-color: white; }
.cta-box .pub-btn-primary { background: white; color: var(--primary); }
.cta-box .pub-btn-primary:hover { box-shadow: 0 8px 25px rgba(0,0,0,0.15); }

/* ===== PUBLIC FOOTER ===== */
.pub-footer {
    background: var(--white);
    border-top: 1px solid var(--border);
    padding: 48px 32px 0;
}

.pub-footer-inner { max-width: 1200px; margin: 0 auto; }

.pub-footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 40px;
    padding-bottom: 36px;
}

.pub-footer-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pub-footer-link {
    display: block;
    font-size: 13px;
    color: var(--dark-secondary);
    text-decoration: none;
    padding: 4px 0;
    transition: var(--t);
}

.pub-footer-link:hover { color: var(--primary); }

.pub-footer-bottom {
    border-top: 1px solid var(--border);
    padding: 20px 0;
    text-align: center;
}

.pub-footer-bottom p { font-size: 12px; color: var(--gray); margin: 0; }

/* ===== RESPONSIVE PUBLIC ===== */
@media (max-width: 768px) {
    .pub-nav { padding: 0 16px; }
    .pub-links { display: none; position: fixed; top: 64px; left: 0; right: 0; background: var(--white); flex-direction: column; padding: 16px; border-bottom: 1px solid var(--border); box-shadow: var(--shadow); }
    .pub-links.show { display: flex; }
    .pub-hamburger { display: flex; }
    .pub-actions { gap: 6px; }
    .pub-actions .pub-btn-ghost { display: none; }

    .hero { padding: 100px 20px 40px; min-height: auto; }
    .hero h1 { font-size: 30px; }
    .hero-sub { font-size: 14px; }
    .hero-search form { padding: 4px 4px 4px 14px; }

    .stats-bar-inner { flex-wrap: wrap; gap: 16px; }
    .sbar-divider { display: none; }
    .sbar-item { min-width: 40%; }

    .pub-section { padding: 40px 16px; }
    .subjects-grid { grid-template-columns: repeat(2, 1fr); }
    .hiw-grid { grid-template-columns: 1fr; }
    .pub-footer-grid { grid-template-columns: 1fr 1fr; gap: 24px; }

    .section-title { font-size: 22px; }
}
