/* [file: wp-content/themes/storefront-storytheme/css/magical-header.css] */

/* ===============================================
   MAGICAL HEADER STYLES - STORYBOT DESIGN SYSTEM
   =============================================== */

/* Import Fonts */
@import url('https://fonts.googleapis.com/css2?family=Spicy+Rice&display=swap');

/* Import StoryBot Theme Variables */
:root {
    /* Dark Theme (Default) - Matching StoryBot */
    --storybot-bg-primary: #1a1a1a;
    --storybot-bg-secondary: #2a2a2a;
    --storybot-bg-tertiary: #3a3a3a;
    --storybot-text-primary: #e0e0e0;
    --storybot-text-secondary: #b5afa9;
    --storybot-accent-primary: #5c6bc0;
    --storybot-accent-hover: #4a59b2;
    --storybot-accent-active: #3f4ea0;
    --storybot-accent-secondary: #007cba;
    --storybot-shadow-light: rgba(0, 0, 0, 0.2);
    --storybot-shadow-medium: rgba(0, 0, 0, 0.3);
}

/* Light Theme - Matching StoryBot */
.storybot-theme-light {
    --storybot-bg-primary: #ffffff;
    --storybot-bg-secondary: #f8f9fa;
    --storybot-bg-tertiary: #e9ecef;
    --storybot-text-primary: #212529;
    --storybot-text-secondary: #495057;
    --storybot-accent-primary: #5c6bc0;
    --storybot-accent-hover: #4a59b2;
    --storybot-accent-active: #3f4ea0;
    --storybot-accent-secondary: #007cba;
    --storybot-shadow-light: rgba(0, 0, 0, 0.1);
    --storybot-shadow-medium: rgba(0, 0, 0, 0.15);
}

/* Reset and Base Styles */
.magical-header * {
    box-sizing: border-box;
}

/* Override any conflicting Storefront styles */
.magical-header .site-header {
    padding-top: 0 !important;
    margin: 0 !important;
}

/* Top Header Bar */
.header-top-bar {
    background: linear-gradient(135deg, var(--storybot-accent-primary) 0%, var(--storybot-accent-hover) 100%);
    padding: 15px 0;
    position: relative;
    z-index: 1000;
    box-shadow: 0 2px 20px var(--storybot-shadow-medium);
    transition: background 0.3s ease;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.header-top-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.hero-content-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    text-align: center;
}

.header-top-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

/* Site Branding */
.site-branding {
    display: flex;
    flex-direction: column;
    gap: 2px;
    align-items: flex-start;
}

.site-logo-name {
    display: flex;
    align-items: center;
    gap: 12px;
}

.magical-icon {
    font-size: 2rem;
    color: #ffd700;
    animation: sparkle 2s ease-in-out infinite;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.8);
}

@keyframes sparkle {
    0%, 100% { transform: scale(1) rotate(0deg); }
    25% { transform: scale(1.1) rotate(5deg); }
    50% { transform: scale(1.2) rotate(-5deg); }
    75% { transform: scale(1.1) rotate(5deg); }
}

.site-title {
    margin: 0;
    font-family: "Madimi One", sans-serif;
    font-size: 1.8rem;
    font-weight: 400;
}

.site-title a {
    color: #ffffff;
    text-decoration: none;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.site-title a:hover {
    color: #ffd700;
    text-shadow: 0 0 15px rgba(255, 215, 0, 0.8);
}

.site-description {
    color: rgba(255, 255, 255, 0.95);
    font-family: "Spicy Rice", cursive;
    font-size: 1rem;
    margin: 0;
    font-style: normal;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.4);
    letter-spacing: 0.5px;
    align-self: flex-start;
    width: 100%;
    text-align: left;
}

/* Header Actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* StoryBot Consistent Button Styling - Fixed Heights */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    box-shadow: 0 2px 4px var(--storybot-shadow-light);
    min-width: auto;
    height: 44px;
    box-sizing: border-box;
    white-space: nowrap; /* Prevent text wrapping */
}

.btn-generate {
    background-color: #ff6b6b;
    color: white;
}

.btn-generate:hover {
    background-color: #ee5a24;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px var(--storybot-shadow-medium);
    color: white;
    text-decoration: none;
}

.btn-login, .btn-account {
    background-color: var(--storybot-accent-primary);
    color: white;
}

.btn-login:hover, .btn-account:hover {
    background-color: var(--storybot-accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px var(--storybot-shadow-medium);
    color: white;
    text-decoration: none;
}

.btn-logout {
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.btn-logout:hover {
    background-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
    color: white;
    text-decoration: none;
}

.btn i {
    font-size: 16px;
    flex-shrink: 0;
}

.user-menu {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 35px;
    height: 35px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    padding: 6px;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1001;
}

.hamburger-line {
    width: 100%;
    height: 3px;
    background: white;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.mobile-menu-toggle:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Magical Hero Section - Using StoryBot Color Scheme */
.magical-hero-section {
    position: relative;
    height: 250px;
    overflow: hidden;
}

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--storybot-accent-primary) 0%, var(--storybot-accent-hover) 50%, var(--storybot-accent-active) 100%);
    background-size: 400% 400%;
    animation: gradientShift 8s ease infinite;
}

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

/* Animated Stars */
.stars-animation {
    position: absolute;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(2px 2px at 20px 30px, rgba(255, 255, 255, 0.8), transparent),
        radial-gradient(2px 2px at 40px 70px, rgba(255, 255, 255, 0.6), transparent),
        radial-gradient(1px 1px at 90px 40px, rgba(255, 255, 255, 0.8), transparent),
        radial-gradient(1px 1px at 130px 80px, rgba(255, 255, 255, 0.6), transparent),
        radial-gradient(2px 2px at 160px 30px, rgba(255, 255, 255, 0.8), transparent);
    background-repeat: repeat;
    background-size: 200px 100px;
    animation: twinkle 4s linear infinite;
    opacity: 0.6;
}

@keyframes twinkle {
    0% { opacity: 0.6; }
    50% { opacity: 0.2; }
    100% { opacity: 0.6; }
}

/* Animated Clouds */
.clouds-animation {
    position: absolute;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(ellipse 80px 40px at 100px 50px, rgba(255, 255, 255, 0.2), transparent),
        radial-gradient(ellipse 60px 30px at 200px 80px, rgba(255, 255, 255, 0.15), transparent),
        radial-gradient(ellipse 100px 50px at 300px 30px, rgba(255, 255, 255, 0.18), transparent);
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateX(0) translateY(0); }
    25% { transform: translateX(10px) translateY(-5px); }
    50% { transform: translateX(0) translateY(-10px); }
    75% { transform: translateX(-10px) translateY(-5px); }
}

/* Hero Content */
.hero-content {
    position: relative;
    z-index: 10;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.hero-title {
    font-family: "Emilys Candy", cursive;
    font-size: 2.5rem;
    color: white;
    margin: 0 0 10px 0;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.4);
    animation: fadeInUp 1s ease-out;
}

.hero-subtitle {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.9);
    margin: 0;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.3);
    animation: fadeInUp 1s ease-out 0.3s both;
}

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

/* Magical Cloud Navigation - Clean Implementation */
.magical-cloud-navigation {
    background: linear-gradient(180deg, rgba(92, 107, 192, 0.25) 0%, rgba(74, 89, 178, 0.20) 100%);
    position: relative;
    padding: 25px 0; /* Increased padding to accommodate hover expansion */
    border: none;
    margin: 0;
    width: 100%;
    overflow: visible; /* Changed from hidden to visible to prevent clipping */
    border-bottom: 1px solid rgba(255, 255, 255, 0.1); /* Add subtle border */
}

/* Cloud background effect */
.magical-cloud-navigation::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(ellipse 100px 30px at 20% 50%, rgba(255, 255, 255, 0.2), transparent),
        radial-gradient(ellipse 120px 40px at 60% 30%, rgba(255, 255, 255, 0.15), transparent),
        radial-gradient(ellipse 80px 25px at 90% 70%, rgba(255, 255, 255, 0.18), transparent);
    pointer-events: none;
}

.magical-nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
    z-index: 10;
}

.magical-nav-wrapper {
    position: relative;
    z-index: 10;
    width: 100%;
    overflow: visible; /* Changed to visible to prevent clipping */
}

.magical-nav-menu {
    display: flex;
    justify-content: center;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 15px 10px; /* Increased padding for hover expansion space */
    gap: 6px; /* Even smaller gap */
    flex-wrap: nowrap;
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
    overflow-x: auto; /* Allow horizontal scroll if needed */
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
    scrollbar-width: none; /* Hide scrollbar on Firefox */
    -ms-overflow-style: none; /* Hide scrollbar on IE/Edge */
}

/* Hide scrollbar on Webkit browsers */
.magical-nav-menu::-webkit-scrollbar {
    display: none;
}

.magical-nav-item {
    margin: 0;
    position: relative;
    flex-shrink: 0; /* Prevent items from shrinking */
    min-width: fit-content;
    /* Add space around items to prevent clipping */
    padding: 8px 2px; /* Vertical and horizontal padding */
}

/* Magical Cloud Pills - Even more compact */
.magical-nav-link {
    display: flex;
    align-items: center;
    gap: 6px; /* Smaller gap */
    padding: 10px 12px; /* More compact padding */
    color: white;
    text-decoration: none;
    font-weight: 600;
    font-size: 12px; /* Smaller font */
    border-radius: 18px; /* Smaller border radius */
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.3) 0%, rgba(255, 255, 255, 0.2) 100%);
    border: 2px solid rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    white-space: nowrap;
    min-width: fit-content;
    box-sizing: border-box;
}

/* Inner glow effect */
.magical-nav-link::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.2) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.4s ease;
    transform: scale(0);
}

/* Icons */
.magical-nav-link i {
    font-size: 14px; /* Smaller icons */
    width: 16px;
    text-align: center;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

/* Hover Effects - More pronounced */
.magical-nav-link:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.6) 0%, rgba(255, 255, 255, 0.4) 100%);
    border-color: rgba(255, 255, 255, 0.8);
    color: white;
    text-decoration: none;
    transform: translateY(-3px) scale(1.08);
    box-shadow: 
        0 8px 25px rgba(0, 0, 0, 0.3),
        0 0 25px rgba(255, 255, 255, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}

.magical-nav-link:hover::before {
    opacity: 1;
    transform: scale(1);
}

.magical-nav-link:hover i {
    transform: scale(1.2);
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
}

/* Individual Color Effects - More vibrant */
.magical-nav-item.color-red .magical-nav-link:hover {
    background: linear-gradient(135deg, rgba(255, 107, 107, 0.8) 0%, rgba(255, 107, 107, 0.6) 100%);
    box-shadow: 
        0 8px 25px rgba(0, 0, 0, 0.3),
        0 0 25px rgba(255, 107, 107, 0.6);
    border-color: rgba(255, 107, 107, 0.9);
}

.magical-nav-item.color-blue .magical-nav-link:hover {
    background: linear-gradient(135deg, rgba(92, 107, 192, 0.8) 0%, rgba(92, 107, 192, 0.6) 100%);
    box-shadow: 
        0 8px 25px rgba(0, 0, 0, 0.3),
        0 0 25px rgba(92, 107, 192, 0.6);
    border-color: rgba(92, 107, 192, 0.9);
}

.magical-nav-item.color-green .magical-nav-link:hover {
    background: linear-gradient(135deg, rgba(139, 195, 74, 0.8) 0%, rgba(139, 195, 74, 0.6) 100%);
    box-shadow: 
        0 8px 25px rgba(0, 0, 0, 0.3),
        0 0 25px rgba(139, 195, 74, 0.6);
    border-color: rgba(139, 195, 74, 0.9);
}

.magical-nav-item.color-purple .magical-nav-link:hover {
    background: linear-gradient(135deg, rgba(156, 39, 176, 0.8) 0%, rgba(156, 39, 176, 0.6) 100%);
    box-shadow: 
        0 8px 25px rgba(0, 0, 0, 0.3),
        0 0 25px rgba(156, 39, 176, 0.6);
    border-color: rgba(156, 39, 176, 0.9);
}

.magical-nav-item.color-orange .magical-nav-link:hover {
    background: linear-gradient(135deg, rgba(255, 152, 0, 0.8) 0%, rgba(255, 152, 0, 0.6) 100%);
    box-shadow: 
        0 8px 25px rgba(0, 0, 0, 0.3),
        0 0 25px rgba(255, 152, 0, 0.6);
    border-color: rgba(255, 152, 0, 0.9);
}

.magical-nav-item.color-gold .magical-nav-link:hover {
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.8) 0%, rgba(255, 193, 7, 0.6) 100%);
    box-shadow: 
        0 8px 25px rgba(0, 0, 0, 0.3),
        0 0 25px rgba(255, 193, 7, 0.6);
    border-color: rgba(255, 193, 7, 0.9);
}

/* Submenu Styling */
.magical-submenu {
    position: absolute;
    top: calc(100% + 5px); /* Slightly closer positioning */
    left: 50%;
    transform: translateX(-50%);
    margin-top: 10px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
}

.magical-submenu-content {
    background: linear-gradient(180deg, rgba(92, 107, 192, 0.95) 0%, rgba(74, 89, 178, 0.95) 100%);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    padding: 15px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    min-width: 200px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.magical-submenu-link {
    color: white;
    text-decoration: none;
    padding: 10px 15px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 13px;
    font-weight: 500;
    transition: all 0.3s ease;
    text-align: center;
}

.magical-submenu-link:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateX(5px) scale(1.02);
    color: white;
    text-decoration: none;
    border-color: rgba(255, 255, 255, 0.5);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Show submenu on hover */
.magical-nav-item.has-submenu:hover .magical-submenu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* Mobile Header Actions Fix */
@media (max-width: 768px) {
    /* Fix header top content layout */
    .header-top-content {
        position: relative;
        display: flex;
        justify-content: space-between;
        align-items: center;
        flex-wrap: nowrap;
    }
    
    /* Ensure header actions don't overlap */
    .header-actions {
        display: flex;
        align-items: center;
        gap: 8px;
        flex-shrink: 0;
        position: relative;
        z-index: 1001;
    }
    
    /* Mobile buttons - stack vertically in dropdown */
    .header-actions .btn {
        display: none; /* Hide by default on mobile */
    }
    
    /* Show only hamburger menu on mobile */
    .mobile-menu-toggle {
        display: flex !important;
        position: relative;
        right: 0;
        top: 0;
        transform: none;
        z-index: 1002;
    }
    
    /* Hide navigation by default on mobile */
    .magical-cloud-navigation {
        display: none;
        padding: 15px 0;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: linear-gradient(180deg, rgba(92, 107, 192, 0.95) 0%, rgba(74, 89, 178, 0.95) 100%);
        backdrop-filter: blur(15px);
        -webkit-backdrop-filter: blur(15px);
        z-index: 1000;
        box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
        border-bottom: 1px solid rgba(255, 255, 255, 0.2);
        overflow: visible; /* Ensure mobile menu isn't clipped */
    }
    
    /* Show navigation when active */
    .magical-cloud-navigation.active {
        display: block;
    }
    
    .magical-nav-container {
        padding: 0 20px;
    }
    
    .magical-nav-menu {
        flex-direction: column;
        gap: 12px;
        padding: 20px 0; /* Adequate padding for mobile */
        align-items: stretch;
        overflow-x: visible;
    }
    
    .magical-nav-item {
        width: 100%;
    }
    
    .magical-nav-link {
        width: 100%;
        justify-content: center;
        padding: 15px 20px;
        font-size: 16px;
        border-radius: 12px;
    }
    
    .magical-nav-link i {
        font-size: 18px;
        width: 20px;
    }
    
    /* Mobile submenu */
    .magical-submenu {
        position: static;
        transform: none;
        opacity: 1;
        visibility: visible;
        margin-top: 8px;
        width: 100%;
    }
    
    .magical-submenu-content {
        width: 100%;
        min-width: auto;
        background: rgba(255, 255, 255, 0.1);
        border: 1px solid rgba(255, 255, 255, 0.2);
    }
    
    /* Fix site branding on mobile */
    .site-branding {
        flex: 1;
        max-width: calc(100% - 60px); /* Leave space for hamburger */
    }
    
    .site-title {
        font-size: 1.2rem;
    }
    
    .magical-icon {
        font-size: 1.3rem;
    }
    
    .site-description {
        font-size: 0.8rem;
    }
}

/* Tablet responsive */
@media (max-width: 1024px) and (min-width: 769px) {
    .magical-nav-link {
        padding: 8px 10px;
        font-size: 11px;
        gap: 4px;
    }
    
    .magical-nav-link i {
        font-size: 13px;
        width: 15px;
    }
    
    .magical-nav-menu {
        gap: 4px;
        padding: 0 5px;
    }
}

/* Large desktop - more spacing */
@media (min-width: 1200px) {
    .magical-nav-link {
        padding: 12px 16px;
        font-size: 13px;
        gap: 8px;
    }
    
    .magical-nav-link i {
        font-size: 15px;
        width: 17px;
    }
    
    .magical-nav-menu {
        gap: 8px;
    }
} 