/* Back to School Theme - Theme-specific variables and styles */

:root {
    /* Back to School Color Palette - Light Mode */
    --theme-primary: #1e3a8a;
    --theme-primary-light: #3b82f6;
    --theme-primary-dark: #1e40af;
    --theme-secondary: #fbbf24;
    --theme-secondary-dark: #f59e0b;
    --theme-accent: #10b981;
    --theme-accent-light: #34d399;
    --theme-highlight: #ef4444;
    --theme-white: #ffffff;
    --theme-dark: #1e293b;
    --theme-dark-gray: #334155;
    --theme-gray: #475569;
    --theme-light-gray: #64748b;
    --theme-bg-light: #f1f5f9;
    --nav-height: 60px;

    /* Light mode specific */
    --theme-body-bg: linear-gradient(180deg, #e2e8f0 0%, #f1f5f9 100%);
    --theme-card-bg: var(--theme-white);
    --theme-card-border: #cbd5e1;
    --theme-text-primary: var(--theme-dark);
    --theme-text-secondary: var(--theme-gray);
    --theme-input-bg: var(--theme-white);
    --theme-nav-bg: var(--theme-white);
    --theme-nav-border: #e2e8f0;
    --theme-modal-bg: var(--theme-white);
    --theme-shadow: rgba(30, 41, 59, 0.1);

    /* Header colors */
    --header-gradient-start: #1e3a8a;
    --header-gradient-mid: #3b82f6;
    --header-gradient-end: #06b6d4;
    --header-accent: #fbbf24;
    --header-text: #ffffff;

    /* Theme color for meta tag */
    --theme-color: #1e3a8a;
}

/* Dark Mode Variables */
[data-theme="dark"] {
    --theme-body-bg: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
    --theme-card-bg: #1e293b;
    --theme-card-border: #334155;
    --theme-text-primary: #f1f5f9;
    --theme-text-secondary: #94a3b8;
    --theme-input-bg: #334155;
    --theme-nav-bg: #1e293b;
    --theme-nav-border: #334155;
    --theme-modal-bg: #1e293b;
    --theme-bg-light: #334155;
    --theme-white: #1e293b;
    --theme-dark: #f1f5f9;
    --theme-gray: #94a3b8;
    --theme-light-gray: #64748b;
    --theme-shadow: rgba(0, 0, 0, 0.3);
}

/* ============================================
   BACK TO SCHOOL HEADER STYLES
   ============================================ */
.bf-header {
    background: linear-gradient(135deg, var(--header-gradient-start) 0%, var(--header-gradient-mid) 50%, var(--header-gradient-end) 100%);
    position: relative;
    overflow: hidden;
    padding: 1.5rem 0.75rem 1.25rem;
    margin-bottom: 1rem;
    border-radius: 0 0 24px 24px;
    box-shadow: 0 4px 20px rgba(30, 58, 138, 0.3);
}

.bf-header.compact {
    padding: 1.25rem 0.75rem;
}

/* Animated gradient overlay */
.bf-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.15) 0%, transparent 40%),
        radial-gradient(circle at 80% 80%, rgba(251, 191, 36, 0.1) 0%, transparent 40%);
    z-index: 1;
}

/* Floating geometric shapes */
.bf-header::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.5;
    pointer-events: none;
    z-index: 1;
}

.bf-banner {
    position: relative;
    text-align: center;
    z-index: 2;
}

/* Subtle shine effect */
.lightning-effect {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent 30%,
        rgba(255, 255, 255, 0.1) 50%,
        transparent 70%
    );
    animation: headerShine 6s ease-in-out infinite;
    z-index: 1;
}

@keyframes headerShine {
    0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
    100% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

/* Modern title styling */
.bf-title {
    font-size: 1.9rem;
    font-weight: 900;
    letter-spacing: -1px;
    margin-bottom: 0.35rem;
    display: flex;
    justify-content: center;
    gap: 0.5rem;
}

.bf-title-compact {
    font-size: 1.75rem;
    font-weight: 900;
    letter-spacing: -1px;
    margin-bottom: 0.25rem;
    display: flex;
    justify-content: center;
    gap: 0.35rem;
}

/* Modern title colors */
.bf-black {
    color: var(--header-accent);
    text-shadow: 0 2px 10px rgba(251, 191, 36, 0.4);
    position: relative;
}

.bf-friday {
    color: var(--header-text);
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    animation: textGlow 3s ease-in-out infinite;
}

@keyframes textGlow {
    0%, 100% {
        opacity: 1;
        text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    }
    50% {
        opacity: 0.95;
        text-shadow: 0 2px 20px rgba(255, 255, 255, 0.3);
    }
}

/* ============================================
   RED PENCIL CIRCLE ANIMATION (for DAYS)
   ============================================ */
.pencil-circle-container {
    position: absolute;
    top: -8px;
    left: -12px;
    right: -12px;
    bottom: -8px;
    pointer-events: none;
    z-index: 10;
}

.pencil-circle-container svg {
    width: 100%;
    height: 100%;
    overflow: visible;
}

.pencil-circle-container .rough-circle {
    fill: none;
    stroke: #ef4444;
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 200;
    stroke-dashoffset: 200;
    animation: drawCircle 1.2s ease-out forwards;
    animation-delay: 0.8s;
    filter: drop-shadow(0 2px 4px rgba(239, 68, 68, 0.4));
}

@keyframes drawCircle {
    0% {
        stroke-dashoffset: 200;
    }
    100% {
        stroke-dashoffset: 0;
    }
}

/* Time segment with circle needs relative positioning */
.time-segment.has-circle {
    position: relative;
}

/* ============================================
   RED PENCIL UNDERLINE (for Catalogues)
   ============================================ */
.pencil-underline-container {
    position: relative;
    width: 70%;
    max-width: 220px;
    height: 12px;
    margin: 0.15rem auto 0.35rem;
    pointer-events: none;
    z-index: 3;
}

.pencil-underline-container .rough-line {
    position: absolute;
    top: 4px;
    left: 0;
    width: 100%;
    height: 100%;
}

.pencil-underline-container .rough-line path {
    fill: none;
    stroke: #ef4444;
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 300;
    stroke-dashoffset: 300;
    animation: drawLine 1s ease-out forwards;
    animation-delay: 0.5s;
    filter: drop-shadow(0 1px 3px rgba(239, 68, 68, 0.4));
}

@keyframes drawLine {
    0% {
        stroke-dashoffset: 300;
    }
    100% {
        stroke-dashoffset: 0;
    }
}

.bf-subtitle {
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 2px;
    color: rgba(255, 255, 255, 0.9);
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

/* School Info Banner */
.school-info-banner {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0.65rem;
    margin-top: 1rem;
}

.info-item {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 0.5rem 1rem;
    text-align: center;
    backdrop-filter: blur(10px);
}

.info-item svg {
    width: 24px;
    height: 24px;
    color: var(--header-accent);
    margin-bottom: 0.25rem;
}

.info-label {
    display: block;
    font-size: 0.625rem;
    color: rgba(255, 255, 255, 0.9);
    letter-spacing: 0.5px;
}

/* Countdown Timer - Modern Glass Style */
.countdown-timer {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0.65rem;
    margin-top: 1rem;
}

.countdown-timer:has(.sale-live) {
    flex-direction: column;
    gap: 0.5rem;
}

.time-segment {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 12px;
    padding: 0.5rem;
    min-width: 55px;
    text-align: center;
    backdrop-filter: blur(10px);
    transition: transform 0.3s ease, background 0.3s ease;
}

.time-segment:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.2);
}

.time-value {
    display: block;
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--header-text);
    line-height: 1.2;
}

.time-label {
    display: block;
    font-size: 0.5625rem;
    color: rgba(255, 255, 255, 0.8);
    margin-top: 0.15rem;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.sale-live {
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--header-accent);
    animation: salePulse 1.5s ease-in-out infinite;
}

@keyframes salePulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.02);
    }
}

/* School Term Countdown */
.school-term-countdown {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    margin-top: 0.75rem;
}

.term-label {
    font-size: 0.75rem;
    color: var(--header-accent);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

.term-time {
    font-size: 1rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.9);
    font-variant-numeric: tabular-nums;
}

/* Theme-specific button colors */
.shop-now-btn {
    background: linear-gradient(135deg, var(--header-gradient-start) 0%, var(--header-gradient-mid) 50%, var(--header-gradient-end) 100%);
    box-shadow: 0 2px 8px rgba(30, 58, 138, 0.25);
}

.shop-now-btn:hover {
    box-shadow: 0 4px 16px rgba(30, 58, 138, 0.4);
}

.view-btn {
    background: linear-gradient(135deg, var(--header-gradient-start) 0%, var(--header-gradient-mid) 50%, var(--header-gradient-end) 100%);
    box-shadow: 0 2px 8px rgba(30, 58, 138, 0.25);
}

.view-btn:hover {
    box-shadow: 0 4px 16px rgba(30, 58, 138, 0.4);
}

.retry-btn {
    background: var(--theme-primary-light);
}

.retry-btn:hover {
    background: var(--theme-primary);
}

/* Theme-specific filter chip active state */
.filter-chip:hover,
.filter-chip.active {
    background: var(--theme-primary-light);
    border-color: var(--theme-primary-light);
    color: #ffffff;
}

/* Theme-specific nav active state */
.nav-item.active {
    color: var(--theme-primary-light);
}

.nav-item.active::before {
    background: var(--theme-primary-light);
}

.nav-item:hover {
    color: var(--theme-primary-light);
}

/* Theme-specific store card hover */
.store-card:hover {
    border-color: var(--theme-primary-light);
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.15);
}

/* Theme-specific modal */
.modal-content {
    border-color: var(--theme-primary-light);
    box-shadow: 0 8px 32px rgba(59, 130, 246, 0.25);
}

.modal-icon {
    color: var(--theme-secondary);
}

.modal-btn-confirm {
    background: linear-gradient(135deg, var(--theme-primary-light), var(--theme-primary));
}

.modal-btn-confirm:hover {
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.4);
}

/* Theme-specific deal badges */
.deal-badge.featured {
    background: linear-gradient(135deg, var(--theme-primary-light), #60a5fa);
}

.deal-badge.new {
    background: linear-gradient(135deg, var(--theme-secondary), var(--theme-secondary-dark));
    color: #1e293b;
}

.deal-badge.datafree {
    background: linear-gradient(135deg, var(--theme-accent), var(--theme-accent-light));
}

/* Logo container background */
.store-logo-container {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), transparent);
}

/* Catalogue header gradient */
.catalogue-header {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.08), rgba(16, 185, 129, 0.08));
}

[data-theme="dark"] .catalogue-header {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(16, 185, 129, 0.15));
}

/* Touch feedback */
button,
a,
.filter-chip {
    -webkit-tap-highlight-color: rgba(59, 130, 246, 0.1);
}

/* Responsive */
@media (min-width: 768px) {
    .bf-title {
        font-size: 3.5rem;
    }
}
