/*
 * Christmas Theme CSS for Jultomtens Verkstad
 * Christmas-specific styles and color variables
 */

/* Christmas Color Variables */
:root {
    /* Christmas-specific colors */
    --christmas-green: #0F4C3A;      /* djup julgrön */
    --christmas-light-green: #2D8B47; /* ljusare grön */
    --christmas-silver: #C0C0C0;     /* silver accent */
    --christmas-white: #FFFEF7;      /* varm vit snö */
    --christmas-dark-red: #8B0000;   /* mörkröd accent */
    
    /* Christmas Font Variables */
    --font-family-christmas: 'Mountains of Christmas', 'Dancing Script', cursive;
}

/* Import Christmas fonts */
@import url('https://fonts.googleapis.com/css2?family=Mountains+of+Christmas:wght@400;700&family=Dancing+Script:wght@400;700&display=swap');

/* Christmas Navigation Styles */
.navbar-christmas {
    background: var(--christmas-green);
    border-bottom: 3px solid var(--brand-gold);
}

.navbar-christmas .navbar-brand {
    color: var(--christmas-white) !important;
    font-weight: 700;
}

.navbar-christmas .navbar-nav .nav-link {
    color: var(--christmas-white) !important;
    font-weight: 500;
    transition: color 0.3s ease;
}

.navbar-christmas .navbar-nav .nav-link:hover {
    color: var(--brand-gold) !important;
}

/* Christmas Hero Section */
.hero-christmas {
    background: var(--brand-red);
    color: var(--christmas-white);
    padding: 3rem 0;
}

.christmas-headline {
    font-family: var(--font-family-christmas);
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

/* Christmas Button Styles */
.btn-christmas-primary {
    background: var(--brand-red);
    border: none;
    color: var(--christmas-white);
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(176, 35, 20, 0.3);
}

.btn-christmas-primary:hover {
    background: var(--christmas-dark-red);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(176, 35, 20, 0.4);
    color: var(--christmas-white);
}

.btn-christmas-secondary {
    background: var(--brand-gold);
    border: none;
    color: var(--dark-color);
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(241, 179, 59, 0.3);
}

.btn-christmas-secondary:hover {
    background: #DAA520;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(241, 179, 59, 0.4);
    color: var(--dark-color);
}

/* Christmas Footer Styles */
.footer-christmas {
    background: var(--christmas-green);
    color: var(--christmas-white);
    border-top: 3px solid var(--brand-gold);
}

.footer-christmas h5,
.footer-christmas h6 {
    color: var(--christmas-white);
    font-weight: 600;
    margin-bottom: 1rem;
}

.footer-christmas h5 i,
.footer-christmas h6::before {
    color: var(--brand-gold);
}

.footer-christmas a {
    color: var(--christmas-silver);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-christmas a:hover {
    color: var(--brand-gold);
}

.footer-christmas .social-links a {
    display: inline-block;
    width: 40px;
    height: 40px;
    line-height: 40px;
    text-align: center;
    background: var(--christmas-white);
    color: var(--christmas-green);
    border-radius: 50%;
    transition: all 0.3s ease;
}

.footer-christmas .social-links a:hover {
    background: var(--brand-gold);
    color: var(--dark-color);
    transform: translateY(-3px);
}

.footer-christmas hr {
    border-color: var(--christmas-silver) !important;
    opacity: 0.3;
}

.footer-christmas .text-warning {
    color: var(--brand-gold) !important;
}

/* Christmas Product Cards */
.christmas-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--brand-red);
    color: var(--christmas-white);
    padding: 0.15rem 0.4rem;
    border-radius: 0.75rem;
    font-size: 0.65rem;
    font-weight: 600;
    z-index: 5;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    white-space: nowrap;
    width: fit-content;
}

.card-christmas {
    border: 1px solid var(--christmas-silver);
    transition: all 0.3s ease;
    overflow: hidden;
}

.card-christmas:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(15, 76, 58, 0.2);
    border-color: var(--brand-gold);
}

.card-christmas .product-image {
    height: 200px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.card-christmas:hover .product-image {
    transform: scale(1.05);
}

@media (prefers-reduced-motion: reduce) {
    .card-christmas:hover {
        transform: none;
    }
    
    .card-christmas:hover .product-image {
        transform: none;
    }
}

.discount-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: var(--brand-gold);
    color: var(--dark-color);
    padding: 0.15rem 0.4rem;
    border-radius: 0.75rem;
    font-size: 0.65rem;
    font-weight: 600;
    z-index: 5;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    white-space: nowrap;
    width: fit-content;
}

/* Christmas Badge Variants */
.christmas-badge--choice {
    background: var(--christmas-green);
}

.christmas-badge--discount {
    background: var(--brand-gold);
    color: var(--dark-color);
    padding: 0.15rem 0.4rem;
    border-radius: 0.75rem;
    font-size: 0.65rem;
    white-space: nowrap;
    width: fit-content;
}

.christmas-badge--bestseller {
    background: var(--brand-orange);
    color: var(--dark-color);
}

/* Enhanced Christmas Card Hover Effects */
.card-christmas::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: var(--brand-gold);
    border-radius: inherit;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.card-christmas:hover::before {
    opacity: 0.7;
}

/* Subtle Christmas Glitter Effect */
@keyframes christmasGlitter {
    0%, 100% { 
        box-shadow: 0 10px 25px rgba(15, 76, 58, 0.2),
                    inset 0 0 20px rgba(241, 179, 59, 0.1);
    }
    50% { 
        box-shadow: 0 15px 35px rgba(15, 76, 58, 0.3),
                    inset 0 0 25px rgba(241, 179, 59, 0.2);
    }
}

.card-christmas:hover {
    animation: christmasGlitter 2s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
    .card-christmas:hover {
        animation: none;
        transform: none;
    }
    
    .card-christmas:hover .product-image {
        transform: none;
    }
    
    .card-christmas::before,
    .card-christmas:hover::before {
        display: none;
    }
}

/* Christmas Footer */
.footer-christmas {
    background: var(--christmas-green);
    border-top: 3px solid var(--brand-gold);
    color: var(--christmas-white);
}

.footer-christmas h5 {
    color: var(--brand-gold);
    font-weight: 700;
}

.footer-christmas a {
    color: var(--christmas-white);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-christmas a:hover {
    color: var(--brand-gold);
}

/* Christmas Text Colors */
.text-christmas-green {
    color: var(--christmas-green) !important;
}

.text-christmas-gold {
    color: var(--brand-gold) !important;
}

.text-christmas-red {
    color: var(--brand-red) !important;
}

/* Christmas Animations - respects prefers-reduced-motion */
/* Snowfall Effect - Base styles (always visible) */
.snowfall {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    overflow: hidden;
}

.snowflake {
    position: absolute;
    top: -10px;
    color: rgba(255, 255, 255, 0.9);
    user-select: none;
    pointer-events: none;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.5),
                 0 2px 4px rgba(0, 0, 0, 0.3);
    filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.2));
    opacity: 0;
}

@media (prefers-reduced-motion: no-preference) {
    .twinkle {
        animation: twinkle 2s infinite alternate;
    }
    
    @keyframes twinkle {
        0% { opacity: 0.7; transform: scale(1); }
        100% { opacity: 1; transform: scale(1.1); }
    }
    
    .christmas-pulse {
        animation: christmas-pulse 3s infinite;
    }
    
    @keyframes christmas-pulse {
        0%, 100% { transform: scale(1); }
        50% { transform: scale(1.05); }
    }

    /* Snowfall Animation */
    .snowflake {
        animation: snowfall linear infinite;
    }

    @keyframes snowfall {
        0% {
            transform: translateY(-100vh) rotate(0deg);
            opacity: 0;
        }
        10% {
            opacity: 0.45;
        }
        90% {
            opacity: 0.45;
        }
        100% {
            transform: translateY(100vh) rotate(360deg);
            opacity: 0;
        }
    }

    /* Christmas Card Hover Effects */
    .card-christmas {
        transition: all 0.3s ease;
    }

    .card-christmas:hover {
        transform: translateY(-5px);
        box-shadow: 0 10px 25px rgba(15, 76, 58, 0.2), 0 0 20px rgba(241, 179, 59, 0.1);
    }

    /* Christmas Button Glow Effect */
    .btn-christmas-primary:hover,
    .btn-christmas-secondary:hover {
        box-shadow: 0 0 20px rgba(241, 179, 59, 0.4);
    }
}

/* Static fallback for reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    .twinkle,
    .christmas-pulse,
    .snowfall {
        animation: none !important;
    }
    
    .card-christmas:hover {
        transform: none;
        box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    }
}

/* Christmas Focus Styles for Accessibility */
.btn-christmas-primary:focus,
.btn-christmas-secondary:focus {
    outline: 3px solid var(--brand-gold);
    outline-offset: 2px;
}

/* Christmas utility classes */
.bg-christmas-red {
    background: var(--brand-red);
}

.border-christmas {
    border: 2px solid var(--brand-gold) !important;
}

/* Christmas Countdown Styling */
#christmas-countdown {
    background: var(--brand-red);
    color: white;
    padding: 1.5rem;
    border-radius: 15px;
    margin: 1rem 0;
    text-align: center;
    box-shadow: 0 4px 15px rgba(220, 53, 69, 0.3);
    border: 2px solid var(--brand-gold);
}

#christmas-countdown .fw-bold {
    font-size: 2rem;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

#christmas-countdown small {
    color: var(--christmas-white);
    opacity: 0.9;
}

/* Christmas Theme Toggle Button */
.christmas-theme-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    background: var(--brand-red);
    color: white;
    border: none;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    font-size: 1.5rem;
    box-shadow: 0 4px 15px rgba(220, 53, 69, 0.4);
    transition: all 0.3s ease;
}

@media (prefers-reduced-motion: no-preference) {
    .christmas-theme-toggle:hover {
        transform: scale(1.1);
        box-shadow: 0 6px 20px rgba(220, 53, 69, 0.6);
    }
}

/* Christmas Toast Notifications */
.christmas-toast {
    background: var(--christmas-green);
    border-radius: 10px;
    transition: opacity 0.3s ease;
}

/* Mobile Optimization for Christmas Elements */
@media (max-width: 768px) {
    .christmas-theme-toggle {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
        bottom: 15px;
        right: 15px;
    }
    
    #christmas-countdown {
        padding: 1rem;
        margin: 0.5rem 0;
    }
    
    #christmas-countdown .fw-bold {
        font-size: 1.5rem;
    }
    
    .snowflake {
        font-size: 0.8rem !important;
    }
}

/* Enhanced Christmas Card Effects */
@media (prefers-reduced-motion: no-preference) {
    .card-christmas {
        position: relative;
        overflow: hidden;
    }
    
    .card-christmas::before {
        content: '';
        position: absolute;
        top: -50%;
        left: -50%;
        width: 200%;
        height: 200%;
        background: rgba(241, 179, 59, 0.1);
        transform: rotate(45deg);
        transition: all 0.6s ease;
        opacity: 0;
    }
    
    .card-christmas:hover::before {
        opacity: 1;
        animation: shimmer 1.5s ease-in-out;
    }
    
    @keyframes shimmer {
        0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
        100% { transform: translateX(100%) translateY(100%) rotate(45deg); }
    }
}

/* Enhanced Product Image Holiday Animation */
.card-christmas .product-image {
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-christmas:hover .product-image {
    transform: scale(1.08) rotate(1deg);
}

/* Christmas Text Effects */
.card-christmas .card-title {
    color: var(--christmas-green);
    transition: color 0.3s ease;
}

.card-christmas:hover .card-title {
    color: var(--brand-gold);
    text-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* Holiday Price Display */
.card-christmas .price-display {
    font-weight: 700;
    color: var(--brand-red);
}

.card-christmas .price-display .discount-price {
    color: var(--christmas-green);
}

/* Christmas Stock Status Styling */
.card-christmas .stock-status {
    font-size: 0.875rem;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-weight: 600;
}

.card-christmas .stock-in {
    background: var(--christmas-green);
    color: white;
}

.card-christmas .stock-low {
    background: var(--brand-orange);
    color: var(--dark-color);
}

.card-christmas .stock-out {
    background: var(--brand-red);
    color: white;
}

/* Christmas Category Badge Styling */
.card-christmas .category-badge {
    background: var(--christmas-green);
    color: var(--christmas-white);
    padding: 0.2rem 0.6rem;
    border-radius: 0.8rem;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Christmas Add to Cart Button */
.card-christmas .btn-add-cart {
    background: var(--christmas-green);
    border: none;
    color: var(--christmas-white);
    font-weight: 600;
    transition: all 0.3s ease;
}

.card-christmas .btn-add-cart:hover {
    background: var(--brand-gold);
    color: var(--dark-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(15, 76, 58, 0.3);
}

.card-christmas .btn-add-cart:disabled {
    background: #6c757d;
    color: #fff;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.card-christmas .btn-add-cart:disabled:hover {
    background: #6c757d;
    transform: none;
}

/* Stats Section Christmas Styling */
.stats-christmas {
    background: var(--christmas-white);
    position: relative;
    overflow: hidden;
}

.stats-christmas::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="50" cy="50" r="2" fill="rgba(241,179,59,0.1)"/><circle cx="20" cy="20" r="1" fill="rgba(15,76,58,0.1)"/><circle cx="80" cy="30" r="1.5" fill="rgba(241,179,59,0.08)"/></svg>') repeat;
    animation: twinkle 15s linear infinite;
    pointer-events: none;
}

@keyframes twinkle {
    0% { transform: translateX(0) translateY(0); }
    100% { transform: translateX(-50px) translateY(-50px); }
}

.stats-card {
    background: rgba(255, 255, 255, 0.95);
    transition: all 0.3s ease;
    position: relative;
    backdrop-filter: blur(10px);
}

.stats-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 35px rgba(15, 76, 58, 0.15) !important;
}

.stats-card .stats-icon {
    position: relative;
}

.stats-card .stats-icon i {
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.stats-card .h2 {
    text-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

@media (prefers-reduced-motion: reduce) {
    .stats-christmas::before {
        animation: none;
    }
    
    .stats-card:hover {
        transform: none;
    }
    
    .stats-card .stats-icon i {
        animation: none;
    }
}

/* Navbar toggler for mobile - ensure white icon on green background */
.navbar-christmas .navbar-toggler {
    border-color: rgba(255, 255, 255, 0.5);
}

.navbar-christmas .navbar-toggler:focus {
    box-shadow: 0 0 0 0.25rem rgba(255, 255, 255, 0.25);
}

.navbar-christmas .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(255, 255, 255, 1)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}
