/* ==========================================================
   HERO SECTION - Uses Master Color System from css.php
   ========================================================== */

/* ===== Hero-Specific Extensions (derived from master) ===== */
.theme-dark {
    --hero-glass-bg: var(--bg-glass);
    --hero-border: var(--border-color);
    --hero-text-primary: var(--text-primary);
    --hero-text-secondary: var(--text-secondary);
    --hero-overlay-bg: var(--bg-overlay);
    --hero-gradient-1: rgba(15, 162, 204, 0.12);
    --hero-gradient-2: rgba(15, 114, 147, 0.08);
    --hero-btn-text-hover: var(--text-inverse);
    --hero-tooltip-bg: rgba(10, 25, 35, 0.95);
    --hero-tooltip-text: var(--text-primary);
    --hero-scroll-text: var(--text-muted);
    --hero-logo-shadow: rgba(0, 0, 0, 0.4);
    --hero-frame-shadow: var(--shadow-lg);
    --hero-bg-brightness: var(--bg-brightness);
    --hero-shimmer: rgba(255, 255, 255, 0.05);
}

.theme-light {
    --hero-glass-bg: var(--bg-glass);
    --hero-border: var(--border-color);
    --hero-text-primary: var(--text-primary);
    --hero-text-secondary: var(--text-secondary);
    --hero-overlay-bg: var(--bg-overlay);
    --hero-gradient-1: rgba(13, 139, 181, 0.08);
    --hero-gradient-2: rgba(13, 139, 181, 0.04);
    --hero-btn-text-hover: var(--text-inverse);
    --hero-tooltip-bg: rgba(13, 59, 76, 0.95);
    --hero-tooltip-text: var(--text-primary);
    --hero-scroll-text: var(--text-muted);
    --hero-logo-shadow: var(--shadow-glow);
    --hero-frame-shadow: var(--shadow-lg);
    --hero-bg-brightness: var(--bg-brightness);
    --hero-shimmer: rgba(13, 139, 181, 0.03);
}

/* ===== Main Hero Section (Uses CSS Variables) ===== */
.pure-hero-section {
    position: relative;
    height: var(--section-height);
    min-height: var(--section-min-height);
    max-height: var(--section-max-height);
    display: flex;
    justify-content: center; 
    align-items: center;
    overflow: hidden;
    isolation: isolate;
    z-index: 1;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
}

/* ===== Animated Background ===== */
.hero-bg-container {
    position: absolute;
    inset: 0;
    z-index: -1;
    overflow: hidden;
}

.hero-bg-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(var(--hero-bg-brightness)) contrast(1.1) saturate(1.05);
    animation: kenBurns 20s ease-in-out infinite alternate;
    transform-origin: center center;
}

@keyframes kenBurns {
    0% { transform: scale(1) translate(0, 0); }
    100% { transform: scale(1.06) translate(-0.5%, -0.5%); }
}

/* ===== Gradient Overlay ===== */
.hero-glass-overlay {
    position: absolute;
    inset: 0;
    z-index: 0;
    background: 
        radial-gradient(ellipse at 25% 25%, var(--hero-gradient-1) 0%, transparent 55%),
        radial-gradient(ellipse at 75% 75%, var(--hero-gradient-2) 0%, transparent 55%),
        var(--hero-overlay-bg);
    backdrop-filter: blur(2px);
}

.hero-glass-overlay::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        135deg,
        transparent 0%,
        var(--hero-gradient-1) 25%,
        transparent 50%,
        var(--hero-gradient-1) 75%,
        transparent 100%
    );
    background-size: 400% 400%;
    animation: gradientShift 10s ease-in-out infinite;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* ===== Floating Particles ===== */
.hero-particles {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    overflow: hidden;
}

.hero-particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--accent);
    border-radius: 50%;
    opacity: 0.4;
    animation: floatParticle 18s ease-in-out infinite;
    box-shadow: 0 0 8px var(--accent-glow);
}

.hero-particle:nth-child(1) { left: 12%; top: 25%; animation-duration: 20s; }
.hero-particle:nth-child(2) { left: 22%; top: 65%; animation-delay: 3s; animation-duration: 24s; width: 5px; height: 5px; }
.hero-particle:nth-child(3) { left: 72%; top: 35%; animation-delay: 6s; animation-duration: 22s; }
.hero-particle:nth-child(4) { left: 87%; top: 72%; animation-delay: 9s; animation-duration: 18s; width: 3px; height: 3px; }
.hero-particle:nth-child(5) { left: 52%; top: 82%; animation-delay: 12s; animation-duration: 26s; width: 5px; height: 5px; }

@keyframes floatParticle {
    0%, 100% { transform: translateY(0) translateX(0) scale(1); opacity: 0.2; }
    25% { transform: translateY(-25px) translateX(8px) scale(1.15); opacity: 0.4; }
    50% { transform: translateY(-15px) translateX(-12px) scale(0.9); opacity: 0.28; }
    75% { transform: translateY(-35px) translateX(4px) scale(1.05); opacity: 0.44; }
}

/* ===== Content Layer ===== */
.hero-content-layer {
    position: relative;
    z-index: 10;
    width: 90%;
    max-width: 520px;
    animation: fadeInUp 1s ease-out;
}

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

/* ===== Glass Frame (Uses CSS Variables) ===== */
.hero-glass-frame {
    width: 100%;
    background: var(--hero-glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--hero-border);
    border-radius: var(--card-radius);
    padding: var(--card-padding-y) var(--card-padding-x);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: var(--card-gap);
    box-shadow: 
        var(--hero-frame-shadow),
        0 0 0 1px rgba(255, 255, 255, 0.03) inset;
    position: relative;
    overflow: hidden;
}

.hero-glass-frame::before {
    content: '';
    position: absolute;
    inset: -2px;
    background: conic-gradient(
        from 0deg at 50% 50%,
        transparent 0deg,
        var(--accent-glow) 50deg,
        transparent 100deg,
        transparent 180deg,
        var(--accent-glow) 230deg,
        transparent 280deg,
        transparent 360deg
    );
    border-radius: calc(var(--card-radius) + 2px);
    z-index: -1;
    animation: borderRotate 6s linear infinite;
    opacity: 0.5;
}

@keyframes borderRotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.hero-glass-frame::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        105deg,
        transparent 40%,
        var(--hero-shimmer) 50%,
        transparent 60%
    );
    background-size: 200% 100%;
    animation: shimmer 6s ease-in-out infinite;
    pointer-events: none;
    border-radius: var(--card-radius);
}

@keyframes shimmer {
    0%, 100% { background-position: 200% 0; }
    50% { background-position: -200% 0; }
}

/* ===== ENHANCED LOGO (3D Floating with Glow) - ENLARGED 200% ===== */
.hero-logo-wrap {
    /* DOUBLED SIZE: 200% of original */
    width: calc(var(--logo-size-lg) * 2);
    height: calc(var(--logo-size-lg) * 2);
    background: linear-gradient(145deg, #ffffff 0%, #f0f4f8 50%, #ffffff 100%);
    border-radius: calc(var(--card-radius) - 8px);
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    animation: logoFloat 4s ease-in-out infinite, logoEntrance 0.8s ease-out 0.3s both;
    box-shadow: 
        0 15px 40px rgba(0, 0, 0, 0.4),
        0 0 0 2px rgba(255, 255, 255, 0.3) inset,
        0 0 60px var(--accent-glow);
    transform-style: preserve-3d;
    perspective: 1000px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    margin-bottom: 15px;
}

/* Floating animation */
@keyframes logoFloat {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    25% { transform: translateY(-12px) rotate(1deg); }
    50% { transform: translateY(-6px) rotate(0deg); }
    75% { transform: translateY(-15px) rotate(-1deg); }
}

/* Classic entrance */
@keyframes logoEntrance {
    from { opacity: 0; transform: scale(0.6) rotate(-8deg); }
    to { opacity: 1; transform: scale(1) rotate(0); }
}

/* Pulse ring effect - SCALED UP */
.hero-logo-wrap::before {
    content: '';
    position: absolute;
    inset: -6px;
    background: conic-gradient(
        from 0deg,
        var(--accent),
        var(--accent-light),
        var(--accent),
        var(--accent-light),
        var(--accent)
    );
    border-radius: calc(var(--card-radius) - 4px);
    z-index: -1;
    animation: rotateRing 3s linear infinite;
    opacity: 0.6;
}

/* Second slower ring - SCALED UP */
.hero-logo-wrap::after {
    content: '';
    position: absolute;
    inset: -12px;
    background: conic-gradient(
        from 180deg,
        rgba(15, 162, 204, 0.3),
        transparent,
        rgba(15, 162, 204, 0.3),
        transparent,
        rgba(15, 162, 204, 0.3)
    );
    border-radius: calc(var(--card-radius) - 0px);
    z-index: -2;
    animation: rotateRing 6s linear infinite reverse;
}

@keyframes rotateRing {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Inner shine effect */
.hero-logo-wrap .shine {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.4) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    opacity: 0;
    animation: shineSweep 4s ease-in-out infinite;
    pointer-events: none;
    z-index: 2;
}

@keyframes shineSweep {
    0%, 100% { opacity: 0; transform: translateX(-100%) skewX(-15deg); }
    50% { opacity: 1; transform: translateX(100%) skewX(-15deg); }
}

/* Enhanced Logo Image - LARGER */
.hero-logo-img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.15));
    transition: transform 0.3s ease;
    animation: logoBreath 3s ease-in-out infinite;
    position: relative;
    z-index: 1;
}

@keyframes logoBreath {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.03); }
}

/* Hover Effects - ENHANCED FOR LARGER SIZE */
.hero-glass-frame:hover .hero-logo-wrap {
    transform: translateY(-8px) scale(1.08);
    box-shadow: 
        0 30px 60px rgba(0, 0, 0, 0.5),
        0 0 0 3px rgba(255, 255, 255, 0.4) inset,
        0 0 80px var(--accent-glow);
}

.hero-glass-frame:hover .hero-logo-img {
    transform: scale(1.08);
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.15));
}

/* ===== Typography (Uses CSS Variables) ===== */
.hero-main-title {
    color: var(--hero-text-primary);
    font-size: var(--text-hero-title);
    font-weight: 700;
    margin: 0;
    animation: titleEntrance 0.8s ease-out 0.5s both;
    letter-spacing: -0.01em;
    line-height: 1.2;
}

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

.hero-title-underline {
    width: var(--underline-width);
    height: 3px;
    background: var(--gradient-accent);
    border-radius: 2px;
    position: relative;
    overflow: hidden;
    animation: underlineEntrance 0.6s ease-out 0.7s both;
}

@keyframes underlineEntrance {
    from { width: 0; opacity: 0; }
    to { width: var(--underline-width); opacity: 1; }
}

.hero-title-underline::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5), transparent);
    animation: underlineShimmer 2.5s ease-in-out infinite;
}

@keyframes underlineShimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.hero-main-subtitle {
    color: var(--hero-text-secondary);
    font-size: var(--text-body);
    animation: subtitleEntrance 0.8s ease-out 0.9s both;
    line-height: 1.55;
    max-width: 90%;
}

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

/* ===== Button (Uses CSS Variables) ===== */
.hero-action-area {
    animation: buttonEntrance 0.8s ease-out 1.1s both;
    margin-top: var(--space-xs);
}

@keyframes buttonEntrance {
    from { opacity: 0; transform: translateY(12px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.hero-cart-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: var(--btn-padding-y) var(--btn-padding-x);
    background: rgba(15, 162, 204, 0.1);
    border: 1.5px solid var(--accent);
    border-radius: 50px;
    color: var(--accent);
    font-weight: 600;
    font-size: var(--btn-font-size);
    cursor: help;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.hero-cart-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(105deg, transparent 30%, rgba(255, 255, 255, 0.15) 50%, transparent 70%);
    transform: translateX(-100%);
    transition: transform 0.5s ease;
}

.hero-cart-btn:hover::before {
    transform: translateX(100%);
}

.hero-cart-btn:hover {
    background: var(--accent);
    color: var(--hero-btn-text-hover);
    transform: translateY(-2px) scale(1.01);
    box-shadow: var(--shadow-glow);
    border-color: var(--accent);
}

.hero-cart-btn svg {
    width: 18px;
    height: 18px;
    transition: transform 0.3s ease;
}

.hero-cart-btn:hover svg {
    transform: rotate(-3deg) scale(1.08);
}

/* ===== Tooltip ===== */
.cart-tooltip {
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%) translateY(8px);
    background: var(--hero-tooltip-bg);
    color: var(--hero-tooltip-text);
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 500;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    border: 1px solid var(--accent);
    backdrop-filter: blur(10px);
}

.cart-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: var(--accent);
}

.hero-cart-btn:hover .cart-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* ===== Scroll Indicator (Uses CSS Variables) ===== */
.hero-scroll-indicator {
    position: absolute;
    bottom: var(--scroll-indicator-bottom);
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    color: var(--hero-scroll-text);
    font-size: var(--text-small);
    font-weight: 500;
    animation: bounce 2.5s ease-in-out infinite;
    cursor: pointer;
    z-index: 10;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.hero-scroll-indicator svg {
    width: 22px;
    height: 22px;
    stroke: var(--accent);
}

@keyframes bounce {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(8px); }
}

/* ===== Mobile Layout Adjustments ===== */
@media (max-width: 768px) {
    .hero-content-layer {
        max-width: 340px;
    }
    
    /* Mobile: 160% size (slightly smaller but still large) */
    .hero-logo-wrap {
        width: calc(var(--logo-size-lg) * 1.6);
        height: calc(var(--logo-size-lg) * 1.6);
        padding: 15px;
        margin-bottom: 10px;
    }
    
    /* Reduce outer ring on mobile */
    .hero-logo-wrap::after {
        display: none;
    }
    
    .hero-logo-wrap::before {
        inset: -4px;
    }
    
    .hero-cart-btn svg {
        width: 16px;
        height: 16px;
    }
    
    /* Reduce particle count for performance */
    .hero-particle:nth-child(4),
    .hero-particle:nth-child(5) {
        display: none;
    }
    
    /* Adjust remaining particle positions */
    .hero-particle:nth-child(1) { left: 15%; top: 20%; }
    .hero-particle:nth-child(2) { left: 85%; top: 30%; }
    .hero-particle:nth-child(3) { left: 50%; top: 75%; }
}

/* ===== Light Theme Specific Adjustments ===== */
.theme-light .hero-logo-wrap {
    background: linear-gradient(145deg, #ffffff 0%, #e8f4f8 50%, #ffffff 100%);
    box-shadow: 
        0 15px 40px rgba(13, 139, 181, 0.25),
        0 0 0 2px rgba(255, 255, 255, 0.5) inset,
        0 0 50px rgba(13, 139, 181, 0.2);
}

.theme-light .hero-logo-wrap::before {
    opacity: 0.4;
}

.theme-light .hero-logo-wrap::after {
    background: conic-gradient(
        from 180deg,
        rgba(13, 139, 181, 0.2),
        transparent,
        rgba(13, 139, 181, 0.2),
        transparent,
        rgba(13, 139, 181, 0.2)
    );
}

/* ===== Reduced Motion ===== */
@media (prefers-reduced-motion: reduce) {
    .hero-bg-img, .hero-glass-overlay::before, .hero-particle,
    .hero-glass-frame::before, .hero-glass-frame::after,
    .hero-logo-wrap, .hero-logo-wrap::before, .hero-logo-wrap::after,
    .hero-logo-img, .hero-logo-wrap .shine,
    .hero-title-underline::after,
    .hero-scroll-indicator { 
        animation: none !important; 
    }
    
    .hero-content-layer, .hero-logo-wrap, .hero-main-title,
    .hero-title-underline, .hero-main-subtitle, .hero-action-area {
        animation: none !important;
        opacity: 1 !important;
        transform: none !important;
    }
    
    .hero-logo-wrap .shine {
        display: none;
    }
}