@import url('https://fonts.googleapis.com/css2?family=Sora:wght@300;400;500;600&family=DM+Mono:wght@400;500&display=swap');

/* ─── Reset & Base ─────────────────────────────────────── */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg:         #0d0f14;
    --bg-card:    #13161d;
    --bg-hover:   #181c26;
    --border:     rgba(255,255,255,0.07);
    --border-hi:  rgba(255,255,255,0.14);

    --accent:     #6c8aff;
    --accent-dim: rgba(108,138,255,0.12);
    --accent-glow:rgba(108,138,255,0.25);

    --green:      #3ecf8e;
    --green-dim:  rgba(62,207,142,0.12);

    --amber:      #f5a524;
    --amber-dim:  rgba(245,165,36,0.12);

    --red:        #f56565;

    --text-1:     #eef0f6;
    --text-2:     #8b91a8;
    --text-3:     #555c75;

    --radius-sm:  6px;
    --radius-md:  10px;
    --radius-lg:  16px;
    --radius-xl:  22px;

    --font:       'Sora', sans-serif;
    --mono:       'DM Mono', monospace;
}

html { scroll-behavior: smooth; }

body {
    font-family: var(--font);
    background-color: var(--bg);
    color: var(--text-1);
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* subtle grid texture */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(108,138,255,0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(108,138,255,0.03) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
    z-index: 0;
}

/* ─── Layout ───────────────────────────────────────────── */
.container {
    max-width: 1160px;
    margin: 0 auto;
    padding: 0 24px;
    position: relative;
    z-index: 1;
}

/* ─── Navbar with Hamburger ────────────────────────────── */
.navbar {
    background: rgba(13,15,20,0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 200;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    height: 60px;
}

.nav-brand a {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-1);
    text-decoration: none;
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: color 0.2s;
}

.nav-brand a:hover { color: var(--accent); }

/* Hamburger Menu Button */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 21px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 210;
}

.hamburger span {
    width: 100%;
    height: 2px;
    background: var(--text-1);
    border-radius: 2px;
    transition: all 0.3s ease;
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* Navigation Menu */
.nav-menu {
    display: flex;
    align-items: center;
    gap: 4px;
}

.nav-menu a {
    color: var(--text-2);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 400;
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
    border: 1px solid transparent;
}

.nav-menu a:hover {
    color: var(--text-1);
    background: rgba(255,255,255,0.05);
}

.nav-menu a#logoutBtn,
.nav-menu a#authLink {
    color: var(--accent);
    border-color: rgba(108,138,255,0.3);
    background: var(--accent-dim);
    font-weight: 500;
}

.nav-menu a#logoutBtn:hover,
.nav-menu a#authLink:hover {
    background: rgba(108,138,255,0.2);
    border-color: rgba(108,138,255,0.5);
}

/* Mobile Navigation */
@media (max-width: 768px) {
    .hamburger {
        display: flex;
    }

    .nav-menu {
        position: fixed;
        top: 60px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 60px);
        background: rgba(13,15,20,0.98);
        backdrop-filter: blur(20px);
        flex-direction: column;
        justify-content: flex-start;
        padding: 20px;
        transition: left 0.3s ease;
        gap: 12px;
        overflow-y: auto;
        z-index: 199;
    }

    .nav-menu.active {
        left: 0;
    }

    .nav-menu a {
        width: 100%;
        text-align: center;
        padding: 14px;
        font-size: 1rem;
        border: 1px solid var(--border);
    }
}

/* ─── Hero ─────────────────────────────────────────────── */
.hero {
    text-align: center;
    padding: 72px 0 48px;
    position: relative;
    animation: fadeUp 0.7s ease both;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0; left: 50%;
    transform: translateX(-50%);
    width: 600px;
    height: 300px;
    background: radial-gradient(ellipse at center, rgba(108,138,255,0.12) 0%, transparent 70%);
    pointer-events: none;
}

.hero h1 {
    font-size: clamp(2rem, 5vw, 3.2rem);
    font-weight: 600;
    letter-spacing: -0.04em;
    line-height: 1.1;
    margin-bottom: 14px;
    background: linear-gradient(135deg, #ffffff 0%, #8b91a8 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.hero p {
    font-size: 1rem;
    color: var(--text-2);
    font-weight: 300;
}

/* ─── Dashboard Title ──────────────────────────────────── */
.container > h1 {
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.03em;
    color: var(--text-1);
    margin: 40px 0 24px;
}

/* ─── Notes / Purchases Grid ───────────────────────────── */
.notes-grid,
.purchases-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
    padding: 8px 0 48px;
}

/* Mobile Grid */
@media (max-width: 768px) {
    .notes-grid,
    .purchases-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
}

/* ─── Note Card ─────────────────────────────────────────── */
.note-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 20px;
    transition: border-color 0.25s, background 0.25s, transform 0.25s;
    animation: fadeUp 0.5s ease both;
    position: relative;
    overflow: hidden;
}

@media (max-width: 480px) {
    .note-card {
        padding: 16px;
    }
}

.note-card::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(108,138,255,0.4), transparent);
    opacity: 0;
    transition: opacity 0.3s;
}

.note-card:hover {
    border-color: var(--border-hi);
    background: var(--bg-hover);
    transform: translateY(-3px);
}

.note-card:hover::after { opacity: 1; }

.note-card h3 {
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--text-1);
    margin-bottom: 8px;
    line-height: 1.4;
}

.note-card p {
    font-size: 0.875rem;
    color: var(--text-2);
    line-height: 1.65;
    margin-bottom: 16px;
    font-weight: 300;
}

.note-price {
    font-family: var(--mono);
    font-size: 1.4rem;
    font-weight: 500;
    color: var(--accent);
    letter-spacing: -0.03em;
    margin-bottom: 16px;
    display: block;
}

/* ─── Buttons ───────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--accent);
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-family: var(--font);
    font-size: 0.875rem;
    font-weight: 500;
    width: 100%;
    transition: all 0.2s;
    position: relative;
    letter-spacing: -0.01em;
}

.btn:hover {
    background: #7d9aff;
    transform: translateY(-1px);
}

.btn:active { transform: scale(0.98); }

.btn-secondary {
    background: var(--green-dim);
    color: var(--green);
    border: 1px solid rgba(62,207,142,0.25);
}

.btn-secondary:hover {
    background: rgba(62,207,142,0.2);
    transform: translateY(-1px);
}

/* ─── Button Group ──────────────────────────────────────── */
.btn-group {
    display: flex;
    gap: 10px;
    margin-top: 16px;
}

.btn-group .btn { flex: 1; }

@media (max-width: 480px) {
    .btn-group {
        flex-direction: column;
    }
}

/* ─── Modal ─────────────────────────────────────────────── */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0,0,0,0.85);
    backdrop-filter: blur(12px);
    animation: fadeIn 0.2s ease;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.modal[style*="block"] {
    display: flex !important;
}

.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border-hi);
    border-radius: var(--radius-xl);
    padding: 32px 28px;
    width: 100%;
    max-width: 420px;
    position: relative;
    animation: scaleIn 0.25s ease;
}

@media (max-width: 480px) {
    .modal-content {
        padding: 24px 20px;
    }
}

.modal-content h2 {
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: -0.03em;
    color: var(--text-1);
    text-align: center;
    margin-bottom: 28px;
}

.close {
    position: absolute;
    right: 20px;
    top: 18px;
    font-size: 1.4rem;
    cursor: pointer;
    color: var(--text-3);
    line-height: 1;
    transition: color 0.2s, transform 0.2s;
}

.close:hover {
    color: var(--text-1);
    transform: rotate(90deg);
}

.modal-content input {
    width: 100%;
    padding: 12px 14px;
    margin-bottom: 12px;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border-hi);
    border-radius: var(--radius-md);
    font-family: var(--font);
    font-size: 0.875rem;
    color: var(--text-1);
    transition: border-color 0.2s, background 0.2s;
    outline: none;
}

.modal-content input::placeholder { color: var(--text-3); }

.modal-content input:focus {
    border-color: rgba(108,138,255,0.5);
    background: rgba(108,138,255,0.04);
}

.modal-content button {
    width: 100%;
    padding: 12px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: var(--radius-md);
    font-family: var(--font);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s;
    margin-top: 8px;
}

.modal-content button:hover { background: #7d9aff; transform: translateY(-1px); }

.modal-content p {
    text-align: center;
    margin-top: 20px;
    font-size: 0.8rem;
    color: var(--text-2);
}

.modal-content a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
}

.modal-content a:hover { text-decoration: underline; }

/* ─── Toast Messages ────────────────────────────────────── */
.success-message,
.error-message,
.info-message {
    position: fixed;
    top: 70px;
    right: 20px;
    left: auto;
    padding: 12px 20px;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 500;
    z-index: 10000;
    animation: slideRight 0.3s ease;
    border: 1px solid;
    max-width: 320px;
}

@media (max-width: 480px) {
    .success-message,
    .error-message,
    .info-message {
        left: 20px;
        right: 20px;
        max-width: none;
        text-align: center;
    }
}

.success-message {
    background: var(--green-dim);
    color: var(--green);
    border-color: rgba(62,207,142,0.25);
}

.error-message {
    background: rgba(245,101,101,0.12);
    color: var(--red);
    border-color: rgba(245,101,101,0.25);
}

.info-message {
    background: var(--accent-dim);
    color: var(--accent);
    border-color: rgba(108,138,255,0.25);
}

/* ─── PDF Secure Modal ──────────────────────────────────── */
.pdf-secure-modal {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 100000;
    background: rgba(0,0,0,0.98);
    backdrop-filter: blur(12px);
    animation: fadeIn 0.25s ease;
    padding: 8px;
}

.pdf-secure-modal-content {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border-hi);
    margin: 0 auto;
    width: 100%;
    max-width: 1100px;
    height: calc(100vh - 16px);
    border-radius: var(--radius-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: scaleIn 0.3s ease;
}

@media (max-width: 768px) {
    .pdf-secure-modal {
        padding: 0;
    }
    
    .pdf-secure-modal-content {
        height: 100vh;
        border-radius: 0;
        margin: 0;
    }
}

.pdf-secure-modal-header {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    color: var(--text-1);
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    flex-shrink: 0;
}

@media (max-width: 480px) {
    .pdf-secure-modal-header {
        flex-direction: column;
        text-align: center;
        padding: 12px;
    }
}

.pdf-secure-icon { margin-right: 6px; font-size: 0.9rem; }

.pdf-secure-btn {
    background: rgba(255,255,255,0.06);
    color: var(--text-2);
    border: 1px solid var(--border-hi);
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-family: var(--font);
    font-size: 0.75rem;
    font-weight: 500;
    transition: all 0.2s;
    margin-left: 6px;
}

.pdf-secure-btn:hover {
    background: rgba(255,255,255,0.1);
    color: var(--text-1);
}

.pdf-secure-close {
    font-size: 1.3rem;
    font-weight: 300;
    line-height: 1;
    cursor: pointer;
    color: var(--text-3);
    transition: color 0.2s;
}

.pdf-secure-close:hover { color: var(--text-1); }

.pdf-secure-modal-body {
    flex: 1;
    background: #1a1a1a;
    overflow: hidden;
}

.pdf-secure-iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.pdf-secure-modal-footer {
    padding: 8px 16px;
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    text-align: center;
    font-size: 0.7rem;
    color: var(--text-3);
    flex-shrink: 0;
}

/* ─── Loading ───────────────────────────────────────────── */
.loading {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 0;
    color: var(--text-3);
    font-size: 0.875rem;
    letter-spacing: 0.04em;
}

.loading::after {
    content: '';
    display: inline-block;
    width: 4px;
    height: 4px;
    background: var(--accent);
    border-radius: 50%;
    margin-left: 6px;
    animation: pulse 1.2s ease infinite;
}

/* ─── Scrollbar ─────────────────────────────────────────── */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: rgba(108,138,255,0.3);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover { background: rgba(108,138,255,0.5); }

/* ─── Animations ────────────────────────────────────────── */
@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

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

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.96); }
    to   { opacity: 1; transform: scale(1); }
}

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

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%       { opacity: 0.4; transform: scale(1.6); }
}

/* ─── Touch-Friendly Tap Targets ───────────────────────── */
@media (max-width: 768px) {
    .btn,
    .nav-menu a,
    .close,
    .pdf-secure-btn,
    .action-btn {
        min-height: 44px;
    }
    
    .btn {
        min-height: 48px;
    }
    
    input,
    select,
    textarea {
        font-size: 16px !important; /* Prevents zoom on iOS */
    }
}
/* ============================================
   ACCESSIBILITY & SEO STYLES
   ============================================ */

/* Skip to main content link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--accent);
    color: white;
    padding: 8px 16px;
    text-decoration: none;
    z-index: 10000;
    transition: top 0.2s;
}

.skip-link:focus {
    top: 0;
}

/* Visually hidden but accessible for screen readers */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus styles for keyboard navigation */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --bg: #000000;
        --bg-card: #111111;
        --text-1: #ffffff;
        --accent: #ffff00;
        --border: rgba(255,255,255,0.3);
    }
    
    .btn,
    .note-card,
    .modal-content {
        border: 2px solid currentColor;
    }
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0a0a0a;
        --bg-card: #141414;
    }
}

/* Print styles */
@media print {
    .navbar,
    .btn,
    .modal,
    .hero::before {
        display: none !important;
    }
    
    .note-card {
        break-inside: avoid;
        page-break-inside: avoid;
        border: 1px solid #ccc;
    }
}

/* Loading state for async content */
[aria-busy="true"] {
    cursor: wait;
    opacity: 0.7;
}

/* Form validation styles */
input:invalid:focus-visible,
select:invalid:focus-visible,
textarea:invalid:focus-visible {
    outline-color: var(--red);
}

.error-message[role="alert"] {
    background: var(--red);
    color: white;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    margin-top: 4px;
    font-size: 0.8rem;
}

/* Coupon Styles */
.coupon-code {
    font-family: monospace;
    letter-spacing: 2px;
    background: rgba(108,138,255,0.1);
    padding: 4px 12px;
    border-radius: 20px;
    display: inline-block;
}

.coupon-input-group input {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    color: white;
    padding: 12px;
    border-radius: 8px;
    width: 100%;
}

.coupon-input-group input:focus {
    outline: none;
    border-color: #6c8aff;
}

#offersSection {
    background: linear-gradient(135deg, rgba(108,138,255,0.05) 0%, rgba(108,138,255,0.02) 100%);
    border-radius: 20px;
    margin: 40px 0;
}

#publicCouponsList .note-card {
    transition: transform 0.3s;
}

#publicCouponsList .note-card:hover {
    transform: translateY(-5px);
}

/* Purchased badge */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    margin-bottom: 10px;
}

.note-thumb {
    font-size: 2rem;
    margin-bottom: 10px;
}

.purchased-badge {
    display: inline-block;
    background: #3ecf8e20;
    color: #3ecf8e;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    margin-bottom: 10px;
}

/* ============================================
   COUPON BANNER - AUTO SHOW & ONE-CLICK APPLY
   ============================================ */

.coupon-banner {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-radius: 12px;
    margin: 20px auto;
    padding: 15px 0;
    border: 1px solid rgba(108, 138, 255, 0.3);
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: thin;
}

.coupon-slider {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.coupon-header {
    display: flex;
    justify-content: center;
    gap: 10px;
    font-size: 1.2rem;
    font-weight: bold;
    color: #6c8aff;
    padding: 0 20px;
}

.coupons-list {
    display: flex;
    gap: 15px;
    padding: 10px 20px;
    overflow-x: auto;
    white-space: nowrap;
}

.coupon-card-mini {
    display: inline-flex;
    align-items: center;
    gap: 15px;
    background: rgba(108, 138, 255, 0.1);
    border: 1px solid rgba(108, 138, 255, 0.3);
    border-radius: 50px;
    padding: 8px 20px;
    transition: all 0.3s;
    cursor: pointer;
    animation: slideIn 0.3s ease;
}

.coupon-card-mini:hover {
    background: rgba(108, 138, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(108, 138, 255, 0.2);
}

.coupon-code-mini {
    font-family: monospace;
    font-size: 1rem;
    font-weight: bold;
    color: #6c8aff;
    letter-spacing: 1px;
}

.coupon-discount-mini {
    font-size: 0.85rem;
    color: #3ecf8e;
}

.coupon-apply-btn {
    background: #3ecf8e;
    color: white;
    border: none;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.7rem;
    cursor: pointer;
    transition: all 0.2s;
}

.coupon-apply-btn:hover {
    background: #2aad6e;
    transform: scale(1.05);
}

.coupon-expiry {
    font-size: 0.65rem;
    color: #888;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .coupon-card-mini {
        padding: 6px 15px;
        gap: 10px;
    }
    
    .coupon-code-mini {
        font-size: 0.8rem;
    }
    
    .coupon-discount-mini {
        font-size: 0.7rem;
    }
}

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


/* ============================================
   MOBILE FIXES - Horizontal Scroll & Centering
   ============================================ */

/* Fix horizontal scroll on mobile */
html, body {
    overflow-x: hidden;
    width: 100%;
    position: relative;
}

.container {
    width: 100%;
    max-width: 1160px;
    overflow-x: hidden;
}

/* Fix notes grid on mobile */
@media (max-width: 768px) {
    .notes-grid,
    .purchases-grid {
        grid-template-columns: 1fr;
        gap: 16px;
        padding: 8px 0 48px;
        width: 100%;
        overflow-x: hidden;
    }
    
    .note-card {
        width: 100%;
        margin: 0;
        padding: 16px;
    }
}

/* Fix Coupon Banner horizontal scroll */
@media (max-width: 768px) {
    .coupon-banner {
        margin: 16px;
        width: calc(100% - 32px);
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .coupons-list {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        padding: 10px 16px;
        gap: 12px;
    }
    
    .coupon-card-mini {
        flex-shrink: 0;
        padding: 6px 12px;
    }
    
    .coupon-code-mini {
        font-size: 0.75rem;
    }
    
    .coupon-discount-mini {
        font-size: 0.65rem;
    }
}

/* Fix Checkout Modal on Mobile */
@media (max-width: 768px) {
    #couponModal .modal-content {
        width: 95%;
        max-width: none;
        margin: 10% auto;
        padding: 20px 16px;
        max-height: 90vh;
        overflow-y: auto;
    }
    
    #couponModal .modal-content h2 {
        font-size: 1.1rem;
        margin-bottom: 16px;
    }
    
    #checkoutNoteDetails {
        padding: 12px !important;
        margin-bottom: 16px !important;
    }
    
    #checkoutNoteDetails div {
        flex-direction: column;
        gap: 8px;
    }
    
    /* Coupon chips container */
    #availableCouponsList {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        max-height: 120px;
        overflow-y: auto;
        margin-bottom: 12px;
    }
    
    .coupon-chip {
        padding: 4px 10px;
        font-size: 0.7rem;
        flex-shrink: 0;
    }
    
    .coupon-chip span {
        font-size: 0.7rem;
    }
    
    /* Manual coupon input */
    #checkoutCouponSection > div:last-child {
        flex-direction: column;
        gap: 8px;
    }
    
    #checkoutCouponSection input {
        width: 100%;
        padding: 10px;
        font-size: 0.85rem;
    }
    
    #checkoutCouponSection button {
        width: 100%;
        padding: 10px;
    }
    
    /* Price breakdown */
    #priceBreakdown {
        padding: 12px !important;
        margin-top: 16px !important;
    }
    
    #priceBreakdown div {
        font-size: 0.85rem;
    }
    
    #priceBreakdown div:last-child {
        font-size: 1rem;
    }
    
    /* Proceed button */
    #couponModal .btn {
        padding: 12px;
        font-size: 0.9rem;
        margin-top: 16px;
    }
}

/* Fix Auth Modal on Mobile */
@media (max-width: 768px) {
    #authModal .modal-content {
        width: 90%;
        padding: 24px 20px;
        margin: 20% auto;
    }
    
    #authModal .modal-content h2 {
        font-size: 1.1rem;
    }
    
    #authModal .modal-content input {
        padding: 10px;
        font-size: 0.85rem;
    }
    
    #authModal .modal-content button {
        padding: 10px;
    }
}

/* Fix Hero Section on Mobile */
@media (max-width: 768px) {
    .hero {
        padding: 40px 0 30px;
    }
    
    .hero h1 {
        font-size: 1.6rem;
        padding: 0 16px;
    }
    
    .hero p {
        font-size: 0.85rem;
        padding: 0 16px;
    }
}

/* Fix Navbar on Mobile */
@media (max-width: 768px) {
    .navbar .container {
        padding: 0 16px;
    }
    
    .nav-brand a {
        font-size: 0.9rem;
    }
}

/* Fix Toast Messages on Mobile */
@media (max-width: 768px) {
    .success-message,
    .error-message,
    .info-message {
        top: auto;
        bottom: 20px;
        left: 16px;
        right: 16px;
        max-width: none;
        text-align: center;
        font-size: 0.8rem;
        padding: 10px 16px;
    }
}

/* Ensure all modals are centered */
.modal {
    display: none;
    align-items: center;
    justify-content: center;
}

.modal[style*="display: flex"],
.modal[style*="display: block"] {
    display: flex !important;
    align-items: center;
    justify-content: center;
}

/* Fix PDF Modal on Mobile */
@media (max-width: 768px) {
    .pdf-secure-modal {
        padding: 0;
    }
    
    .pdf-secure-modal-content {
        width: 100%;
        height: 100%;
        border-radius: 0;
        margin: 0;
    }
    
    .pdf-secure-modal-header {
        padding: 10px;
        flex-direction: column;
        gap: 8px;
    }
    
    .pdf-secure-modal-header h3 {
        font-size: 0.9rem;
    }
    
    .pdf-secure-btn {
        padding: 4px 10px;
        font-size: 0.7rem;
    }
    
    .pdf-secure-modal-footer {
        font-size: 0.6rem;
        padding: 6px;
    }
}

/* Fix for very small phones */
@media (max-width: 380px) {
    .note-card {
        padding: 12px;
    }
    
    .note-price {
        font-size: 1.2rem;
    }
    
    .btn {
        padding: 8px 12px;
        font-size: 0.8rem;
    }
    
    .coupon-card-mini {
        padding: 4px 10px;
    }
    
    .coupon-code-mini {
        font-size: 0.7rem;
    }
    
    .coupon-discount-mini {
        font-size: 0.6rem;
    }
}

/* ============================================
   ADVANCED ANIMATIONS
   ============================================ */

/* Page Load Animation */
@keyframes pageLoad {
    0% {
        opacity: 0;
        transform: scale(0.98);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

body {
    animation: pageLoad 0.5s ease-out;
}

/* Floating Animation for Cards */
@keyframes float {
    0% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-5px);
    }
    100% {
        transform: translateY(0px);
    }
}

.note-card:hover {
    animation: float 0.5s ease-in-out;
}

/* Glow Effect on Hover */
@keyframes glow {
    0% {
        box-shadow: 0 0 5px rgba(108, 138, 255, 0.2);
        border-color: rgba(108, 138, 255, 0.3);
    }
    100% {
        box-shadow: 0 0 20px rgba(108, 138, 255, 0.5);
        border-color: rgba(108, 138, 255, 0.8);
    }
}

.btn:hover {
    animation: glow 0.3s ease-in-out forwards;
}

/* Pulse Animation for Badges */
@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.8;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.purchased-badge {
    animation: pulse 2s ease-in-out infinite;
}

/* Shimmer Effect for Coupons */
@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

.coupon-card-mini {
    background: linear-gradient(
        90deg,
        rgba(108, 138, 255, 0.1) 0%,
        rgba(108, 138, 255, 0.2) 50%,
        rgba(108, 138, 255, 0.1) 100%
    );
    background-size: 200% 100%;
    animation: shimmer 3s infinite;
}

/* Slide In from Left */
@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Slide In from Right */
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Bounce Effect */
@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.hero h1 {
    animation: slideInLeft 0.8s ease-out;
}

.hero p {
    animation: slideInRight 0.8s ease-out;
}

/* Rotate Animation for Icons */
@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.nav-brand a:hover {
    animation: rotate 0.5s ease-in-out;
}

/* Typing Effect for Hero */
@keyframes typing {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

@keyframes blink {
    50% {
        border-color: transparent;
    }
}

/* Loading Spinner Animation */
@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.loading::after {
    animation: spin 1s linear infinite;
}

/* Ripple Effect */
@keyframes ripple {
    0% {
        transform: scale(0);
        opacity: 0.5;
    }
    100% {
        transform: scale(4);
        opacity: 0;
    }
}

.btn {
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:active::after {
    width: 300px;
    height: 300px;
}

/* Stagger Animation for Cards */
.note-card:nth-child(1) { animation-delay: 0.1s; }
.note-card:nth-child(2) { animation-delay: 0.2s; }
.note-card:nth-child(3) { animation-delay: 0.3s; }
.note-card:nth-child(4) { animation-delay: 0.4s; }
.note-card:nth-child(5) { animation-delay: 0.5s; }
.note-card:nth-child(6) { animation-delay: 0.6s; }

/* Hover Scale Effect */
@keyframes scaleUp {
    from {
        transform: scale(1);
    }
    to {
        transform: scale(1.05);
    }
}

.note-card:hover {
    animation: scaleUp 0.3s ease-out forwards;
}

/* Modal Pop Animation */
@keyframes modalPop {
    0% {
        opacity: 0;
        transform: scale(0.7);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-content {
    animation: modalPop 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* Toast Slide Animation */
@keyframes toastSlide {
    0% {
        transform: translateX(100%);
        opacity: 0;
    }
    100% {
        transform: translateX(0);
        opacity: 1;
    }
}

.success-message,
.error-message,
.info-message {
    animation: toastSlide 0.3s ease-out;
}

/* Background Gradient Animation */
@keyframes gradientBG {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.coupon-banner {
    background: linear-gradient(135deg, #1a1a2e, #16213e, #1a1a2e);
    background-size: 200% 200%;
    animation: gradientBG 5s ease infinite;
}

/* Text Glow Animation */
@keyframes textGlow {
    0% {
        text-shadow: 0 0 5px rgba(108, 138, 255, 0.5);
    }
    100% {
        text-shadow: 0 0 20px rgba(108, 138, 255, 0.8);
    }
}

.nav-brand a:hover {
    animation: textGlow 0.5s ease-in-out;
}

/* Heartbeat Animation for CTA */
@keyframes heartbeat {
    0% {
        transform: scale(1);
    }
    14% {
        transform: scale(1.3);
    }
    28% {
        transform: scale(1);
    }
    42% {
        transform: scale(1.3);
    }
    70% {
        transform: scale(1);
    }
}

.btn-primary {
    animation: heartbeat 1.5s ease-in-out infinite;
}

.btn-primary:hover {
    animation: none;
}

/* Wave Animation */
@keyframes wave {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.hero h1 span {
    display: inline-block;
    animation: wave 1s ease-in-out infinite;
}

/* Fade In Up with Delay */
@keyframes fadeInUpDelay {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.stat-card {
    animation: fadeInUpDelay 0.5s ease-out;
}

.stat-card:nth-child(1) { animation-delay: 0.1s; }
.stat-card:nth-child(2) { animation-delay: 0.2s; }
.stat-card:nth-child(3) { animation-delay: 0.3s; }
.stat-card:nth-child(4) { animation-delay: 0.4s; }

/* Rotate In Animation */
@keyframes rotateIn {
    from {
        opacity: 0;
        transform: rotate(-180deg) scale(0.3);
    }
    to {
        opacity: 1;
        transform: rotate(0) scale(1);
    }
}

.coupon-chip {
    animation: rotateIn 0.5s ease-out;
}

/* Blink Animation for New Items */
@keyframes blink {
    0%, 100% {
        background-color: transparent;
    }
    50% {
        background-color: rgba(108, 138, 255, 0.2);
    }
}

.new-note {
    animation: blink 1s ease-in-out 3;
}

/* Scroll Reveal Animation */
@keyframes reveal {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.reveal {
    animation: reveal 0.6s ease-out;
}

/* Loading Skeleton Animation */
@keyframes skeleton {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

.skeleton {
    background: linear-gradient(90deg, #1a1a2e 25%, #2a2a3e 50%, #1a1a2e 75%);
    background-size: 200% 100%;
    animation: skeleton 1.5s infinite;
}

/* Particle Background Animation */
@keyframes floatParticle {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(-100vh) rotate(360deg);
        opacity: 0;
    }
}

/* Success Checkmark Animation */
@keyframes checkmark {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.checkmark {
    animation: checkmark 0.5s ease-out;
}

/* ============================================
   ENHANCED HOVER EFFECTS
   ============================================ */

/* Image Zoom Effect */
.note-thumb {
    transition: transform 0.3s ease;
}

.note-card:hover .note-thumb {
    transform: scale(1.1);
}

/* Link Underline Effect */
.nav-menu a {
    position: relative;
}

.nav-menu a::before {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent), var(--green));
    transition: width 0.3s ease;
}

.nav-menu a:hover::before {
    width: 100%;
}

/* Card Border Glow */
.note-card {
    transition: all 0.3s ease;
}

.note-card:hover {
    box-shadow: 0 0 20px rgba(108, 138, 255, 0.3);
}

/* Button Hover Effect */
.btn {
    position: relative;
    overflow: hidden;
}

.btn span {
    position: relative;
    z-index: 1;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

/* Input Focus Effect */
input, textarea, select {
    transition: all 0.3s ease;
}

input:focus, textarea:focus, select:focus {
    transform: translateY(-2px);
}

/* Modal Backdrop Blur */
.modal {
    backdrop-filter: blur(10px);
    transition: backdrop-filter 0.3s ease;
}

/* Smooth Scroll Behavior */
html {
    scroll-behavior: smooth;
}

/* Custom Cursor on Buttons */
.btn, .coupon-chip, .nav-menu a {
    cursor: pointer;
    transition: all 0.2s ease;
}

/* Loading Animation Enhancement */
.loading {
    position: relative;
}

.loading::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin-top: -20px;
    margin-left: -20px;
    border: 3px solid rgba(108, 138, 255, 0.2);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* Footer Styling */
.footer {
    background: #0f172a;
    color: #ffffff;
    padding: 30px 0;
    margin-top: 40px;
}

.footer .container {
    max-width: 1100px;
    margin: auto;
    padding: 0 20px;
    text-align: center;
}

/* Links */
.footer-links {
    margin-bottom: 15px;
}

.footer-links a {
    color: #cbd5f5;
    text-decoration: none;
    margin: 0 12px;
    font-size: 14px;
    transition: 0.3s;
}

.footer-links a:hover {
    color: #38bdf8;
    text-decoration: underline;
}

/* Copyright */
.footer-copyright {
    font-size: 13px;
    color: #94a3b8;
}

/* Responsive */
@media (max-width: 600px) {
    .footer-links {
        display: flex;
        flex-direction: column;
        gap: 8px;
    }

    .footer-links a {
        margin: 5px 0;
    }
}

/* ============================================
   SUBJECT FILTER SECTION - ADD THIS AT THE END
   ============================================ */

.subject-filter-section {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    margin: 20px 0;
    overflow: hidden;
}

.filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: rgba(108,138,255,0.05);
    cursor: pointer;
    font-weight: 600;
    color: var(--text-1);
}

.filter-toggle {
    background: none;
    border: none;
    color: var(--accent);
    cursor: pointer;
    font-size: 1rem;
    transition: transform 0.3s;
}

.filter-toggle.rotated {
    transform: rotate(180deg);
}

.subject-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 15px 20px;
    border-top: 1px solid var(--border);
    max-height: 200px;
    overflow-y: auto;
    transition: all 0.3s;
}

.subject-buttons.collapsed {
    display: none;
}

.subject-btn {
    background: var(--bg-hover);
    border: 1px solid var(--border);
    color: var(--text-2);
    padding: 8px 18px;
    border-radius: 30px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.subject-btn:hover {
    background: var(--accent-dim);
    border-color: var(--accent);
    color: var(--accent);
}

.subject-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

/* Subject Badge on Note Card */
.note-subject-badge {
    display: inline-block;
    background: rgba(108,138,255,0.1);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.7rem;
    margin-bottom: 8px;
    color: var(--accent);
}

/* Mobile Responsive for Subject Filter */
@media (max-width: 768px) {
    .subject-buttons {
        gap: 8px;
        padding: 12px 15px;
    }
    
    .subject-btn {
        padding: 6px 14px;
        font-size: 0.75rem;
    }
}