/* ============================================================
   GLOBAL RESET
============================================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}


body {
    font-family: 'Inter', system-ui, sans-serif;
    background: #fafafa;
    color: #222;
    line-height: 1.5;
    padding-bottom: 40px;
    max-width: 100vw;
    overflow-x: clip; /* does NOT break sticky */
}

/* ============================================================
   TOPBAR
============================================================ */
.topbar {
    background: #5c4cb7;
    color: white;
    padding: 14px 18px;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 1000;
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 0px;
}



.topbar h1 {
    font-size: 1.4rem;
    font-weight: 600;
}

.left-side {
    display: flex;
    align-items: center;
    gap: 12px;
}



/* ============================================================
   NAV BUTTONS
============================================================ */
/* .ui-btn {
    all: unset;              
    box-sizing: border-box;  
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    user-select: none;
    caret-color: transparent;
    border-radius: 6px;
    transition: background 0.2s, border-color 0.2s, transform 0.1s;
} */
.ui-btn {
    all: unset;
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    user-select: none;
    caret-color: transparent;
    border-radius: 6px;
    transition: background 0.2s, border-color 0.2s, transform 0.1s;
}
.topbar-buttons {
    display: flex;
    gap: 10px;
    margin-left: auto;
    align-items: center;
    min-width: 0;
}


.nav-btn {
    background: white;
    color: #4a6fa5;
    border: none;
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s;
}


.nav-btn img.icon {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    pointer-events: none;

}

.nav-btn:hover {
    background: #e8eef7;
}

/* ============================================================
   PAGE CONTAINER
============================================================ */
.page-container {
    padding: 20px;
    max-width: 900px;
    margin: 0 auto;
}

/* ============================================================
   SECTION HEADERS
============================================================ */
section h2 {
    margin-bottom: 10px;
    font-size: 1.3rem;
    font-weight: 600;
    color: #333;
}

/* ============================================================
   BOOK STRIPS (horizontal scrolling rows)
============================================================ */

.category-block {
    border: 2px solid #ddd;
    border-radius: 12px;
    padding: 12px 0 16px 0;
    margin: 20px 16px;
    background: #fafafa;
}
.category-block h2 {
    margin: 0 0 12px 0;
    padding: 8px 12px;
    background: #f0f0f0;
    border-radius: 6px;
    font-size: 1.1rem;
}

.book-strip {
    display: flex;
    flex-direction: row;
    gap: 12px;
    overflow-x: auto;
    padding: 0 16px;
    scroll-snap-type: x mandatory;
    /* margin-left:10px; this to have a left margin before the first book */

}

.book-strip::-webkit-scrollbar {
    height: 6px;
}

.book-strip::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

/* Each book tile */
.book-card {
    flex: 0 0 auto;
    width: 180px;
    scroll-snap-align: start;
    text-align: center;
    cursor: pointer;
}

.book-card img {
    width: 100%;
    border-radius: 6px;
    box-shadow: 0 3px 6px rgba(45,0,80,0.25);
}

/* ============================================================
   BUTTONS (primary + secondary)
============================================================ */
.primary-btn {
    background: #4a6fa5;
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s;
}

.primary-btn:hover {
    background: #3d5c89;
}

.secondary-btn {
    background: #ddd;
    color: #333;
    border: none;
    padding: 10px 16px;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s;
}

.secondary-btn:hover {
    background: #ccc;
}

/* ============================================================
   INPUTS
============================================================ */
input[type="text"],
input[type="email"],
input[type="password"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #bbb;
    border-radius: 6px;
    font-size: 1rem;
    margin-bottom: 12px;
}

/* ============================================================
   ACCOUNT PAGE (minimal overrides)
============================================================ */
.account-section {
    margin-bottom: 20px;
    padding: 16px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.account-section h3 {
    margin-bottom: 8px;
    font-size: 1.1rem;
}

/* ============================================================
   PURCHASE PAGE (global-friendly)
============================================================ */
.purchase-container {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    max-width: 600px;
    margin: 0 auto;
}

.purchase-cover {
    width: 180px;
    margin-bottom: 16px;
    border-radius: 6px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

/* ============================================================
   READER PAGE
============================================================ */

.reader-block {
    margin-bottom: 20px;
}

.reader-block img {
    max-width: 100%;
    border-radius: 6px;
}

/* ============================================================
   MOBILE RESPONSIVE
============================================================ */
@media (max-width: 600px) {
    .nav-btn {
        padding: 8px 10px;
        font-size: 0.85rem;
    }

}

.topbar a {
    text-decoration: none;
    color: inherit;
}

.topbar a:visited {
    color: inherit;
}

.topbar a {
    -webkit-tap-highlight-color: transparent;
}
.topbar a.attention {
    animation: pulse 1.4s ease-out;
}

@keyframes pulse {
    0%   { transform: scale(1); opacity: 1; }
    50%  { transform: scale(1.04); opacity: 0.85; }
    100% { transform: scale(1); opacity: 1; }
}

.topbar a.attention2 {
    animation: wiggle .6s ease-in-out;
    animation-iteration-count: 2; 
}

@keyframes wiggle {
    0% { transform: rotate(0deg); }
    25% { transform: rotate(1deg); }
    50% { transform: rotate(-1deg); }
    75% { transform: rotate(1deg); }
    100% { transform: rotate(0deg); }
}

/* -------------------------------------------------------
   HEADER NAV BUTTON — large rectangular topbar button
------------------------------------------------------- */
.header-nav-btn {
    width: 80px;
    height: 40px;
    border-radius: 6px;

    display: flex;
    align-items: center;
    justify-content: center;

    background: #eee;
    border: 1px solid #ccc;

    cursor: pointer;
    user-select: none;
    caret-color: transparent;

    transition: background 0.2s ease, border-color 0.2s ease;
}

.header-nav-btn:hover {
    background: #e4e4e4;
    border-color: #b5b5b5;
}

.header-nav-btn img.icon {
    height: 24px;
    width: auto;
    object-fit: contain;
    pointer-events: none;
}