/* ===================================================
   PrepForge — Notebook Theme CSS
   Ruled lines, paper texture, spiral binding, sidebar tabs
   =================================================== */

/* ─── App Shell Layout ───────────────────────────────── */
#app { height: 100vh; overflow: hidden; }
#app-shell {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* ─── Sidebar ────────────────────────────────────────── */
.sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    background: var(--bg-sidebar);
    height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 100;
    overflow: hidden;
    transition: width var(--transition-slow), min-width var(--transition-slow);
}

/* Spiral binding decoration */
.sidebar::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 18px;
    background: repeating-linear-gradient(
        to bottom,
        transparent 0px,
        transparent 26px,
        rgba(255,255,255,0.08) 26px,
        rgba(255,255,255,0.08) 36px
    );
    pointer-events: none;
    z-index: 1;
}

/* Spiral circles */
.sidebar::after {
    content: '';
    position: absolute;
    left: 6px;
    top: 20px;
    bottom: 20px;
    width: 8px;
    background: repeating-radial-gradient(
        circle at center,
        rgba(255,255,255,0.15) 0px,
        rgba(255,255,255,0.15) 4px,
        transparent 4px,
        transparent 31px
    );
    pointer-events: none;
    z-index: 2;
}

.sidebar-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding-left: 20px; /* account for spiral */
    overflow-y: auto;
    overflow-x: hidden;
}

/* Logo */
.sidebar-logo {
    padding: 1.25rem 1rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    margin-bottom: 0.5rem;
}
.sidebar-logo-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}
.sidebar-logo-text {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    color: #fff;
    font-weight: 700;
    letter-spacing: -0.02em;
}
.sidebar-logo-sub {
    font-size: 0.65rem;
    color: rgba(255,255,255,0.4);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    line-height: 1;
}

/* Nav Section */
.sidebar-nav { flex: 1; padding: 0.5rem 0.75rem; }
.sidebar-nav-label {
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.3);
    padding: 0.75rem 0.5rem 0.35rem;
}

/* Nav Items — notebook tab style */
.nav-item {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.6rem 0.75rem;
    border-radius: var(--radius-md);
    color: rgba(255,255,255,0.55);
    font-size: 0.875rem;
    font-weight: 450;
    cursor: pointer;
    transition: all var(--transition);
    margin-bottom: 0.15rem;
    position: relative;
    border: 1px solid transparent;
    user-select: none;
}
.nav-item:hover {
    background: rgba(255,255,255,0.07);
    color: rgba(255,255,255,0.85);
    border-color: rgba(255,255,255,0.06);
}
.nav-item.active {
    background: rgba(255,255,255,0.12);
    color: #fff;
    border-color: rgba(255,255,255,0.10);
}
/* Left colored indicator */
.nav-item.active::before {
    content: '';
    position: absolute;
    left: -1px;
    top: 25%;
    bottom: 25%;
    width: 3px;
    background: var(--nav-item-color, #f59e0b);
    border-radius: 0 2px 2px 0;
}
.nav-item-icon {
    width: 20px;
    text-align: center;
    flex-shrink: 0;
    font-size: 0.95rem;
    opacity: 0.9;
}
.nav-item-badge {
    margin-left: auto;
    background: var(--accent-red);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.1rem 0.4rem;
    border-radius: var(--radius-full);
    min-width: 18px;
    text-align: center;
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 0.75rem 1rem;
    border-top: 1px solid rgba(255,255,255,0.08);
    display: flex;
    align-items: center;
    gap: 0.6rem;
}
.sidebar-user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-blue));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 0.875rem;
    font-weight: 600;
    flex-shrink: 0;
}
.sidebar-user-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: rgba(255,255,255,0.8);
    flex: 1;
    truncate: overflow: hidden;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sidebar-logout-btn {
    color: rgba(255,255,255,0.35);
    font-size: 0.875rem;
    transition: color var(--transition);
    padding: 0.25rem;
}
.sidebar-logout-btn:hover { color: var(--accent-red); }

/* ─── Main Content Area ──────────────────────────────── */
.main-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Topbar */
.topbar {
    height: var(--topbar-height);
    background: var(--bg-topbar);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    gap: 1rem;
    flex-shrink: 0;
    position: relative;
    z-index: 50;
}
.topbar-left { display: flex; align-items: center; gap: 0.75rem; flex: 1; }
.topbar-title {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    color: var(--ink-primary);
}
.topbar-right { display: flex; align-items: center; gap: 0.5rem; }

/* Theme toggle button */
.theme-toggle {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    border: 1.5px solid var(--border);
    background: var(--bg-hover);
    color: var(--ink-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: all var(--transition);
}
.theme-toggle:hover { border-color: var(--accent-amber); color: var(--accent-amber); transform: rotate(20deg); }

/* ─── Content Page ───────────────────────────────────── */
.page-content {
    flex: 1;
    overflow-y: auto;
    padding: 1.75rem 2rem;
    background: var(--bg-main);
    position: relative;
}

/* Notebook ruled lines background */
.page-content::before {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        to bottom,
        transparent 0px,
        transparent calc(var(--rule-spacing) - 1px),
        var(--rule-color) calc(var(--rule-spacing) - 1px),
        var(--rule-color) var(--rule-spacing)
    );
    pointer-events: none;
    opacity: 0.35;
}

/* Red margin line */
.page-content::after {
    content: '';
    position: absolute;
    left: 64px;
    top: 0;
    bottom: 0;
    width: 1.5px;
    background: var(--rule-margin);
    opacity: 0.25;
    pointer-events: none;
}

/* Content sits above the ruled lines */
.page-inner {
    position: relative;
    z-index: 1;
    max-width: 1200px;
    margin: 0 auto;
}

/* ─── Grid Layouts ───────────────────────────────────── */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.25rem;
}
.cards-grid-sm {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}
.cards-grid-lg {
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
}

/* ─── Quick Capture FAB ──────────────────────────────── */
.quick-capture-fab {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-amber), #f59e0b);
    color: #fff;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(217,119,6,0.4);
    z-index: 500;
    transition: all var(--transition);
    border: none;
}
.quick-capture-fab:hover {
    transform: scale(1.1) rotate(45deg);
    box-shadow: 0 6px 28px rgba(217,119,6,0.5);
}

/* ─── Login Screen ───────────────────────────────────── */
#login-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0f0d1a 0%, #1a1530 40%, #0d1a2e 100%);
    position: relative;
    overflow: hidden;
    padding: 1rem;
}

/* Animated background dots */
#login-screen::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle, rgba(255,255,255,0.04) 1px, transparent 1px);
    background-size: 28px 28px;
    pointer-events: none;
}

.login-card {
    background: rgba(255,255,255,0.04);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--radius-xl);
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
    position: relative;
    z-index: 1;
}
.login-logo {
    text-align: center;
    margin-bottom: 2rem;
}
.login-logo-icon {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    margin: 0 auto 1rem;
    box-shadow: 0 8px 32px rgba(245,158,11,0.35);
}
.login-app-name {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    color: #fff;
    font-weight: 700;
}
.login-app-sub {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.45);
    margin-top: 0.25rem;
}
.login-card .input {
    background: rgba(255,255,255,0.07);
    border-color: rgba(255,255,255,0.12);
    color: #fff;
}
.login-card .input:focus { border-color: #f59e0b; box-shadow: 0 0 0 3px rgba(245,158,11,0.2); }
.login-card .input::placeholder { color: rgba(255,255,255,0.3); }
.login-card .form-label { color: rgba(255,255,255,0.5); }
.login-card .btn-primary {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    border-color: transparent;
    width: 100%;
    justify-content: center;
    padding: 0.75rem;
    font-size: 0.95rem;
}
.login-divider {
    text-align: center;
    color: rgba(255,255,255,0.3);
    font-size: 0.8rem;
    margin: 1rem 0;
    position: relative;
}
.login-divider::before, .login-divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 38%;
    height: 1px;
    background: rgba(255,255,255,0.1);
}
.login-divider::before { left: 0; }
.login-divider::after  { right: 0; }
.btn-google {
    width: 100%;
    justify-content: center;
    padding: 0.75rem;
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.12);
    color: #fff;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 500;
    gap: 0.6rem;
    transition: all var(--transition);
}
.btn-google:hover { background: rgba(255,255,255,0.12); }
.login-error {
    color: #f87171;
    font-size: 0.82rem;
    text-align: center;
    display: none;
    margin-top: 0.5rem;
}
