/**
 * Mobile Header CSS - Fun Zone
 * Header-specific mobile styles including navigation
 * Includes header layout, logo, nav menu, and gradients
 */

/* ===== Header Variables (Required for gradient) ===== */
:root {
  /* Original Alberta Tradesman Brand Colors */
  --color-burnt-orange: #DD6B20;
  --color-sky-blue: #2B6CB0;
  --color-charcoal: #2D3748;
  --color-dark-gray: #1A202C;
  --color-white: #FFFFFF;

  /* Extended Palette */
  --color-orange-light: #FED7AA;
  --color-orange-dark: #9C4221;
  --color-blue-light: #DBEAFE;
  --color-blue-dark: #1E4788;

  /* Original Gradients - Blue to Orange */
  --gradient-primary: linear-gradient(135deg, #2B6CB0, #DD6B20);
  --gradient-soft: linear-gradient(135deg, #DBEAFE, #FED7AA);
  --gradient-dark: linear-gradient(135deg, #1E4788, #9C4221);

  /* Header Specific */
  --header-height: 130px;
  --header-height-mobile: 100px;

  /* Z-Index Layers */
  --z-header: 200;
  --z-dropdown: 1001;
  --z-banner: 1000;
}

/* ===== Ensure Header Has Gradient Background ===== */
.site-header {
  background: var(--gradient-primary) !important;
  color: white;
  position: relative;
  overflow: visible;
}

/* ===== Grid Pattern Background ===== */
.site-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 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");
  animation: pattern-drift 20s linear infinite;
  pointer-events: none;
  z-index: 0;
}

@keyframes pattern-drift {
  0% { transform: translate(0, 0); }
  100% { transform: translate(60px, 60px); }
}

/* ===== Ensure content is above pattern ===== */
.header-content {
  position: relative;
  z-index: 1;
}

/* ===== Header Base Mobile ===== */
@media (max-width: 768px) {
  .site-header {
    height: var(--header-height-mobile);
    padding: 0 1rem;
    background: var(--gradient-primary) !important;
  }

  .header-content {
    gap: 1rem;
  }

  /* Hide "Fun Zone" text on mobile, will be replaced with CSS */
  .header-logo-text {
    font-size: 1.3rem;
    position: relative;
  }

  /* Replace "Fun Zone" with "Pun Zone" on mobile using CSS */
  .header-logo-text {
    visibility: hidden;
    position: relative;
  }

  .header-logo-text::after {
    content: "Pun Zone";
    visibility: visible;
    position: absolute;
    left: 0;
    top: 0;
  }

  .header-subtitle {
    font-size: 0.75rem; /* Smaller subtitle on mobile */
    line-height: 1.2;
    max-width: 150px; /* Limit width to prevent overflow */
  }

  .header-logo-img {
    height: calc(var(--header-height-mobile) * 0.7); /* Slightly smaller logo */
  }

  /* Navigation menu mobile */
  .nav-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--gradient-primary) !important;
    flex-direction: column;
    padding: 1rem;
    gap: 0.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    z-index: var(--z-dropdown, 1001);
  }

  .nav-menu.mobile-open {
    display: flex;
  }

  .mobile-menu-toggle {
    display: none !important; /* Disabled for Fun Zone */
  }

  .header-actions {
    gap: 0.5rem;
  }

  .header-button {
    padding: 0.4rem 0.8rem;
    font-size: 0.9rem;
  }

  /* Hide original text in Fun Features button on mobile */
  .fun-features-btn {
    font-size: 0 !important;
  }

  .fun-features-btn::before {
    content: "🎪 Features";
    font-size: 0.9rem;
    display: inline-block;
  }

  /* Mobile Dropdown Adjustments */
  .dropdown-menu {
    right: 0; /* Align to right edge of button */
    left: auto; /* Remove left alignment */
    min-width: 250px;
    width: auto;
    max-width: calc(100vw - 20px); /* Prevent overflow with some margin */
    transform: translateX(0); /* Reset any transforms */
  }

  .dropdown-toggle {
    font-size: 0.9rem;
    padding: 0.4rem 0.8rem;
  }

  .dropdown-item {
    padding: 0.8rem 1rem;
  }

  .dropdown-item span {
    font-size: 0.9rem;
  }

  .dropdown-item small {
    font-size: 0.75rem;
  }

  /* Breadcrumb mobile */
  .breadcrumb {
    padding: 0.4rem 1rem;
    font-size: 0.8rem;
  }
}

/* ===== Small Mobile Header ===== */
@media (max-width: 480px) {
  .header-content {
    gap: 0.75rem; /* Tighter gap on small screens */
  }

  .header-logo {
    gap: 0.75rem; /* Less gap between logo and text */
  }

  /* Even smaller text on very small screens */
  .header-logo-text {
    font-size: 1.1rem;
  }

  .header-logo-text::after {
    content: "Pun Zone";
    font-size: 1.1rem;
  }

  .header-subtitle {
    font-size: 0.65rem; /* Very small subtitle */
    line-height: 1.1;
    max-width: 120px; /* Even more limited width */
  }

  .header-logo-img {
    height: calc(var(--header-height-mobile) * 0.6); /* Smaller logo on tiny screens */
  }

  .header-actions {
    flex-direction: column;
    gap: 0.3rem;
  }

  .header-button {
    padding: 0.3rem 0.6rem;
    font-size: 0.8rem;
  }

  /* Even smaller button text on very small screens */
  .fun-features-btn::before {
    font-size: 0.8rem !important;
  }

  .dropdown-menu {
    right: 0; /* Keep aligned to right on small screens */
    left: auto;
    width: auto;
    min-width: 240px;
    max-width: calc(100vw - 10px); /* Even tighter on small screens */
    margin-right: 5px; /* Small margin from edge */
  }
}

/* ===== Header Variables Mobile ===== */
@media (max-width: 768px) {
  :root {
    --header-height-mobile: 100px;
  }
}

/* ===== Coffee & Features Banners Mobile ===== */
@media (max-width: 768px) {
  .coffee-banner,
  .features-banner {
    font-size: 10px;
    width: 160px;
    padding: 4px 0;
  }

  .coffee-banner {
    left: -40px;
    top: 10px;
  }

  .features-banner {
    right: -40px;
    top: 10px;
  }
}

@media (max-width: 480px) {
  .coffee-banner,
  .features-banner {
    font-size: 8px;
    width: 120px;
    padding: 3px 0;
  }

  .coffee-banner {
    left: -30px;
    top: 8px;
  }

  .features-banner {
    right: -30px;
    top: 8px;
  }
}

/* ===== Header Print Styles ===== */
@media print {
  .site-header {
    display: none !important;
  }
}