﻿
/* Import Nunito + Cormorant Garamond from Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;500;600;700&family=Cormorant+Garamond:wght@500;600;700&display=swap');

/* Root variables */
:root {
    --font-size: 16px;
    --font-family: 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-heading: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;

    /* Brand palette */
    --color-primary: #1E4356;
    --color-secondary: #846A9B;
    --color-accent: #F0B176;
    --color-accent-highlight: #E9801F;
    --color-bg: #FFFFFF;
    --color-text-primary: #24323D;
    --color-text-secondary: #6B7280;
    --color-border: #E8E4DF;

    /* Secondary accent tones (cards, badges) */
    --color-secondary-dark: #5B3E78;
    --color-sage: #7C9473;
    --color-sage-dark: #56715A;
    --color-secondary-tint: #EDE7F3;
    --color-sage-tint: #EEF2E9;
}

/* Apply site-wide */
body {
    font-family: var(--font-family);
    font-size: var(--font-size);
    line-height: 1.5;
    color: #212529; /* optional: default text color */
}

/* Optional: headings can be slightly heavier */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-family);
    font-weight: 600; /* Semi-bold for headings */
}

body {
    font-family: var(--font-family);
    font-size: var(--font-size);
    line-height: 1.5;
    color: #212529;
}

/* ==========================================================================
   Site-wide paper texture background
   Applied to `body` only, never to components. Every card/panel/input/
   sidebar/modal in the Quillstone design system already sets its own
   explicit white background (see workbooks.css/worksheets.css/learning.css
   and Bootstrap's own modal/form-control defaults), so this texture only
   ever shows through in the page's own margins/gutters behind them.
   Generated as an inline SVG fractal-noise tile (stitchTiles="stitch")
   rather than a raster image so it repeats with zero visible seams at any
   resolution/zoom, needs no extra binary asset, and is trivial to retune.
   Kept to ~15% opacity (verified against a rendered screenshot) so it
   reads as warmth, not pattern, with no meaningful effect on text contrast
   since text always sits on an opaque white component background. */
body {
    background-color: var(--color-bg);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240' viewBox='0 0 240 240'%3E%3Cfilter id='paperGrain' x='0' y='0' width='100%25' height='100%25'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch' result='noise'/%3E%3CfeColorMatrix in='noise' type='saturate' values='0' result='gray'/%3E%3CfeColorMatrix in='gray' type='matrix' values='1 0 0 0 0 0 0.94 0 0 0 0 0 0.82 0 0 0 0 0 1 0'/%3E%3C/filter%3E%3Crect width='240' height='240' filter='url(%23paperGrain)' opacity='0.30'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 240px 240px;
}

@media (min-width: 768px) {
    :root {
        --font-size: 16px;
    }
}

.card .d-flex > span {
    min-width: 80px; /* Prevent numbers from touching the edge */
}

footer {
    position: relative;
    bottom: auto;
}


/**/
/*-------------------Default Style-----------------------*/
.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
    position: relative;
    min-height: 100%;
}
/*-------------------Toast Notification-----------------------*/
.toast-container {
    z-index: 99999;
    top: 70px; /* adjust if navbar overlaps */
}

/* ==========================================
   User Profile Dropdown & Glass-morphism
   ========================================== */
.user-greeting-toggle {
    font-weight: 500;
    color: #212529;
    border: none;
    background: none;
    padding: 0.375rem 0.5rem;
}

    .user-greeting-toggle:hover,
    .user-greeting-toggle:focus {
        color: #000;
        background: none;
        box-shadow: none;
    }

.glass-dropdown {
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, 0.55);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.13), 0 1.5px 6px rgba(0,0,0,0.07);
    border-radius: 14px;
    min-width: 210px;
    padding: 6px;
}

    .glass-dropdown .dropdown-item {
        border-radius: 8px;
        padding: 0.45rem 0.85rem;
        font-size: 0.875rem;
        color: #1a1a1a;
        transition: background 0.15s ease;
    }

        .glass-dropdown .dropdown-item:hover,
        .glass-dropdown .dropdown-item:focus {
            background: rgba(0, 0, 0, 0.06);
            color: #000;
        }

        .glass-dropdown .dropdown-item.text-danger:hover {
            background: rgba(220, 53, 69, 0.08);
        }

    .glass-dropdown .dropdown-divider {
        border-color: rgba(0, 0, 0, 0.1);
    }

/* Custom Tooltip Styling */
.custom-tooltip .tooltip-inner {
    background-color: #4f46e5;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    font-size: 0.8rem;
    padding: 0.5rem 0.75rem;
}

.custom-tooltip .tooltip-arrow::before {
    border-left-color: #4f46e5;
}

/* ==========================================================================
   Global Image Preview Modal & Carousel Styles
   ========================================================================== */

#globalImageModal .modal-body {
    background: transparent;
}

#globalImageModal .carousel-item {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
}

#globalImageModal .slide-content {
    background: transparent;
    padding: 6px;
    border-radius: 6px;
    box-shadow: none;
}

#globalImageModal .carousel-image {
    max-height: 85vh;
    width: auto;
    height: auto;
    display: block;
    touch-action: none;
}

#globalImageModal .zoom-controls {
    position: absolute;
    right: 12px;
    top: 12px;
    z-index: 1050;
    display: flex;
    gap: 6px;
}

#globalImageModal .btn-close,
#localImageModal .btn-close {
    z-index: 3000;
    pointer-events: auto;
}

#globalImageModal .zoom-controls button {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #e9ecef;
}

#globalImageModal .carousel-control-prev,
#globalImageModal .carousel-control-next {
    z-index: 1040;
}

/* Changed from @@media to @media for standard CSS file processing */
@media (max-width: 576px) {
    #globalImageModal .slide-content {
        padding: 6px;
    }
}

/* -----------------------Filters,Search and Dropdown-------------------------------- */

/* Make selects consistent with search input */
.filter-select, .filter-input {
    width: 100%;
    background-color: #fff; /* white background */
    border: 1px solid #ced4da; /* Bootstrap default border */
    border-radius: 0.25rem;
    padding: 0.375rem 0.75rem; /* same padding as .form-control */
    font-size: 1rem; /* match search input */
    box-sizing: border-box;
}
/* Ensure dropdown options don't overflow mobile */
@media (max-width: 767.98px) {
    .filter-select {
        font-size: 0.9rem; /* slightly smaller on mobile if needed */
    }
}
/* === FILTER NORMALIZATION === */
.filter-bar .form-control,
.filter-bar .form-select,
.filter-bar .choices__inner {
    height: 44px;
    min-height: 44px;
    line-height: 1.4;
    font-size: 0.95rem;
    border-radius: 6px;
}


/* Remove extra padding Choices adds */
.filter-bar .choices__inner {
    padding: 6px 10px;
    background-color: #fff;
}
/* Align text vertically inside Choices */
.filter-bar .choices__list--single {
    padding: 0;
}
/* === CHECKBOX SIZE NORMALIZATION === */
.filter-check .form-check-input {
    width: 18px;
    height: 18px;
    margin-top: 0;
}

.filter-check .form-check-label {
    font-size: 0.9rem;
    margin-left: 6px;
}

.filter-btn {
    height: 44px;
    padding: 0 20px;
}
/* Desktop: do NOT stretch */
@media (min-width: 768px) {
    .filter-btn {
        width: auto;
    }
}
/* Mobile: full width */
@media (max-width: 767.98px) {
    .filter-btn {
        width: 100%;
    }
}
/* Prevent right-edge overflow on mobile */
.filter-bar {
    margin-left: 0;
    margin-right: 0;
}

    .filter-bar > [class*="col-"] {
        padding-left: 8px;
        padding-right: 8px;
    }
    /* Force Choices wrapper to respect column width */
    .filter-bar .choices {
        width: 100% !important;
    }


/*------------------------_workbookCard----------------------------------------------*/

/*_workbookCard*/
.card-rounded {
    border-radius: 1rem !important;
    overflow: hidden;
}
/* Clamp description to 2 lines on cards */
.card-description-clamp {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 0.85rem;
    line-height: 1.35;
    color: #6c757d;
}

.img-placeholder {
    background-color: #e9ecef; /* light gray */
    height: 180px;
    object-fit: cover;
}

/* Hover lift effect */
.card-hover-lift {
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

    .card-hover-lift:hover {
        transform: translateY(-5px); /* slightly lift */
        box-shadow: 0 10px 20px rgba(0, 0, 0, 0.12); /* subtle shadow */
    }

/* Card Titles */
.card h5.card-title {
    font-family: var(--font-family);
    font-weight: 600; /* semi-bold */
    font-size: 1.05rem;
    line-height: 1.3;
    margin-bottom: 0.25rem;
}

/* Card Description */
.card .card-text {
    font-family: var(--font-family);
    font-weight: 400;
    font-size: 0.9rem;
    color: #6c757d; /* muted gray */
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Small labels like Grade / Subject / Pages */
.card .badge, .card .card-subtext {
    font-family: var(--font-family);
    font-size: 0.79rem;
    font-weight: 500;
}


.workbook-card .add-to-cart-btn {
    height: 38px; /* consistent height */
    text-align: center;
    white-space: nowrap; /* prevents text wrap */
}

@media (max-width: 576px) {
    .workbook-card .add-to-cart-btn {
        width: 100%;  stacked buttons on mobile 
    }
}

/*.workbook-card-actions .btn {
    min-height: 42px;
    font-weight: 500;
    white-space: nowrap;
}

.workbook-card-actions .btn-outline-primary {
    border-width: 1.5px;
}

.workbook-card-actions .btn-primary {
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

@media (max-width: 576px) {
    .workbook-card-actions .btn {
        font-size: 0.9rem;
    }
}
*/

/* -------------------------------- Cart layout fixes ---------------------- */


.cart-page {
    padding-bottom: 4rem;
}

/* Empty state */
.cart-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 40vh;
    text-align: center;
}

.cart-empty-icon {
    font-size: 3.5rem;
    color: #dee2e6;
    margin-bottom: 1rem;
}


/* Summary panel */
.cart-panel {
    border-radius: 14px;
    border: 1px solid #e9ecef;
    background: #fff;
    box-shadow: 0 2px 16px rgba(0,0,0,0.07);
}

/* Cart list container rounded like card */
.list-group {
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid #dee2e6;
}
/* ----------------------------
   Cart Item Row
---------------------------- */
.cart-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: nowrap;
    border-bottom: 1px solid #dee2e6; /* subtle horizontal divider */
    padding: 1rem 0.75rem; /* vertical padding */
    min-height: 92px;
    position: relative; /* for remove button */
    background-color: #fff;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

    /* Hover effect */
    .cart-item:hover {
        box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
        z-index: 1;
    }


    /* ----------------------------
   Cover Image
---------------------------- */
    .cart-item img {
        width: 60px;
        height: auto;
        flex-shrink: 0;
        border-radius: 12px;
        border: 1px solid #dee2e6;
    }

    /* ----------------------------
   Title + Format container
---------------------------- */
    .cart-item .flex-grow-1 {
        flex: 1 1 auto;
    }

/* ----------------------------
   Quantity Controls (pill style)
---------------------------- */
.cart-qty-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 10px;
    gap: 4px;
    width: 86px;
    flex: 0 0 auto;
    padding: 2px 4px;
}

/* Qty buttons */
.qty-btn {
    background: none;
    border: none;
    width: 24px;
    height: 24px;
    font-size: 13px;
    cursor: pointer;
    border-radius: 6px;
    font-weight: 700;
    color: #212529;
}

    .qty-btn:hover {
        background-color: #e9ecef;
    }

/* Qty number / pill */
.qty-value {
    width: 32px;
    text-align: center;
    font-size: 14px;
    border-left: 1px solid #dee2e6;
    border-right: 1px solid #dee2e6;
    line-height: 24px; /* vertical centering */
    display: inline-block;
}

/* ----------------------------
   Unit Price & Line Total
---------------------------- */
.cart-price {
    width: 88px;
    text-align: right;
    flex: 0 0 auto;
    border-left: 1px solid #dee2e6;
    padding-left: 0.75rem;
}

.cart-line-total {
    width: 110px;
    text-align: right;
    font-weight: 600;
    flex: 0 0 auto;
    border-left: 1px solid #dee2e6;
    padding-left: 0.75rem;
}

/* ----------------------------
   Remove Button (top-right)
---------------------------- */
.cart-remove-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    font-size: 16px;
    line-height: 1;
    color: #6c757d;
    background: none;
    border: none;
    cursor: pointer;
}

    .cart-remove-btn:hover {
        color: #dc3545;
    }

/* ----------------------------
   Responsive
---------------------------- */
@media (max-width: 991px) {
    .cart-item {
        padding: 0.75rem 0.5rem;
    }

    .cart-qty-controls {
        width: 88px;
    }

    .cart-price {
        width: 80px;
    }

    .cart-line-total {
        width: 96px;
    }
}

@media (max-width: 768px) {
    .order-summary {
        position: static !important;
        margin-bottom: 2rem;
    }
}

@media (max-width: 576px) {
    .cart-item {
        flex-wrap: wrap;
        align-items: flex-start;
        row-gap: 0.75rem;
        padding-right: 2.25rem; /* space for ❌ */
    }

        /* Image smaller */
        .cart-item img {
            width: 56px;
        }

        /* Title block full width */
        .cart-item .flex-grow-1 {
            width: calc(100% - 72px);
        }

    /* Qty + unit price stay together */
    .cart-qty-controls {
        order: 3;
        border: 1px solid #dee2e6; /* ensure visible border on mobile */
        padding: 2px 4px;
    }

    .cart-price {
        order: 4;
        margin-left: 0.5rem;
        border-left: 1px solid #dee2e6; /* keep border consistent */
        padding-left: 0.5rem;
    }

    /* Line total aligned right on its own row */
    .cart-line-total {
        order: 5;
        margin-left: auto;
        border-left: none;
    }
}
/* ----------------------------
   Order Summary
---------------------------- */
.order-summary {
    border-radius: 16px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
    top: 80px;
    z-index: 10;
}



/* ----------------------------
  cart subtotal 
---------------------------- */

/*.cart-list-subtotal {
    border-top: 1px solid #dee2e6;
}*/

/* Matches all columns before Line Total */
.cart-subtotal-spacer {
    flex: 1 1 auto;
}

/* Matches Line Total column width */
.cart-subtotal-label {
    width: 110px;
    padding-right: 7.99rem;
    font-weight: 500;
    white-space: nowrap;
   /* text-align: right;*/
}

.cart-subtotal-value {
    width: 110px;
    padding-right: 2.25rem;
    text-align: right;
}


.btn-action-primary {
    font-family: var(--font-family);
    font-weight: 700;
    color: #FFFFFF;
    background-color: var(--color-accent-highlight);
    border: 1px solid var(--color-accent-highlight);
    border-radius: 999px;
    transition: all 0.2s ease;
}

    .btn-action-primary:hover,
    .btn-action-primary:focus {
        background-color: var(--color-primary);
        border-color: var(--color-primary);
        color: #FFFFFF;
    }

/*--------------------------------link decoration------------------------------------------*/
.link-plain {
    text-decoration: none;
    color: inherit;
}

    .link-plain:hover {
        text-decoration: underline; /* optional */
    }


/* Only affects Admin Order Status dropdown */
.admin-status-dropdown .dropdown-menu {
    max-height: 250px; /* Prevent very long lists from spilling */
    overflow-y: auto; /* Scroll if necessary */
    min-width: 120px; /* Ensure reasonable width */
}

.admin-status-dropdown .btn-sm {
    font-size: 0.85rem; /* Smaller buttons for a compact look */
    padding: 0.25rem 0.5rem;
}

.admin-status-dropdown .d-flex {
    flex-wrap: wrap; /* Wrap on mobile */
    gap: 0.5rem;
}

/*---------------------------------Confirmation Page---------------------------------------*/

/* Make table scrollable on small screens */
.checkout-confirmation .table-responsive {
    overflow-x: auto;
}

/* Smaller font on mobile */
@media (max-width: 576px) {
    .checkout-confirmation table th,
    .checkout-confirmation table td {
        font-size: 0.9rem;
    }

    .order-totals {
        font-size: 1rem;
    }
}


/* =========================
   PRODUCT CARD (BASE)
   ========================= */

.product-card {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    transition: all 0.2s ease-in-out;
    height: 100%;
}

    /* Hover effect */
    .product-card:hover {
        transform: translateY(-3px);
        box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
        border-color: #cbd5e1;
    }

    /* Image section */
    .product-card img {
        width: 100%;
        height: 180px;
        object-fit: cover;
    }

/* Body */
.product-card-body {
    padding: 12px 14px;
}

/* Title */
.product-card-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 6px;
    color: #111827;
}

/* Subtitle */
.product-card-subtitle {
    font-size: 0.85rem;
    color: #6b7280;
    margin-bottom: 10px;
}

/* Meta row */
.product-card-meta {
    font-size: 0.8rem;
    color: #374151;
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
}

/* Price */
.product-card-price {
    font-weight: 600;
    color: #16a34a;
}

/* Button area */
.product-card-footer {
    padding: 10px 14px;
    border-top: 1px solid #f1f5f9;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* ==========================================================================
   Site Header / Navbar (Quillstone visual refresh)
   ========================================================================== */

.site-header {
    background-color: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
    box-shadow: 0 1px 2px rgba(30, 67, 86, 0.04);
}

.site-header .navbar {
    padding-top: 0.85rem;
    padding-bottom: 0.85rem;
}

/* Brand lockup */
.brand-lockup {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    text-decoration: none;
}

    .brand-lockup:hover .brand-name {
        color: var(--color-secondary);
    }

.brand-icon {
   /* width: 34px;
    height: 34px;*/
   width:auto;
   height:30px;
    flex-shrink: 0;
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.brand-name {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.65rem;
    color: var(--color-primary);
    transition: color 0.2s ease;
}

.brand-tagline {
    font-family: var(--font-family);
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    color: var(--color-text-secondary);
}

/* Primary navigation */
.main-nav .nav-link {
    font-family: var(--font-family);
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--color-text-primary);
    padding: 0.5rem 0.9rem;
    margin: 0 0.1rem;
    position: relative;
    transition: color 0.2s ease;
}

    .main-nav .nav-link::after {
        content: "";
        position: absolute;
        left: 0.9rem;
        right: 0.9rem;
        bottom: 0.15rem;
        height: 2px;
        background: var(--color-accent-highlight);
        border-radius: 2px;
        transform: scaleX(0);
        transform-origin: center;
        transition: transform 0.2s ease;
    }

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

        .main-nav .nav-link:hover::after {
            transform: scaleX(1);
        }

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

        .main-nav .nav-link.active-nav-link::after {
            transform: scaleX(1);
        }

/* Search icon button */
.nav-search-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: var(--color-text-primary);
    font-size: 1.05rem;
    transition: background-color 0.2s ease, color 0.2s ease;
}

    .nav-search-link:hover {
        background-color: rgba(30, 67, 86, 0.06);
        color: var(--color-primary);
    }

/* Google sign-in button */
.btn-google-signin {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    font-family: var(--font-family);
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--color-text-primary);
    background-color: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 999px;
    padding: 0.5rem 1.15rem;
    transition: box-shadow 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

    .btn-google-signin:hover {
        box-shadow: 0 4px 14px rgba(30, 67, 86, 0.12);
        border-color: var(--color-secondary);
        color: var(--color-text-primary);
        transform: translateY(-1px);
    }

    .btn-google-signin svg {
        width: 18px;
        height: 18px;
    }

/* My Learning link */
.nav-mylearning-link {
    font-family: var(--font-family);
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--color-text-primary);
    padding: 0.5rem 0.75rem;
    transition: color 0.2s ease;
}

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

/* "Hi, Name" greeting toggle — palette alignment (keeps existing glass-dropdown behaviour) */
.user-greeting-toggle {
    font-family: var(--font-family);
    font-weight: 600;
    color: var(--color-text-primary);
    border-radius: 999px;
}

    .user-greeting-toggle:hover,
    .user-greeting-toggle:focus {
        color: var(--color-primary);
    }

@media (max-width: 991.98px) {
    .main-nav .nav-link::after {
        display: none;
    }

    .main-nav .nav-link.active-nav-link {
        background-color: rgba(30, 67, 86, 0.06);
        border-radius: 8px;
    }

    .brand-tagline {
        display: none;
    }
}


