/*
Theme Name: hikoi.org.nz
Theme URI: https://philbotha.co.nz/
Description: Custom Divi Child Theme
Author: Phil Botha Creative
Author URI: https://philbotha.co.nz/
Template: Divi
Version: Updated for Divi 3+
*/




/* =================================
   CUSTOM DIVI MOBILE MENU OVERRIDE
   ================================= */

/* Make header transparent */
@media (max-width: 980px) {
  #main-header {
    background-color: transparent !important;
    box-shadow: none !important;
  }
  .et_header_style_left .logo_container {
    position: absolute;
    height: 150px;
    width: 100%;
    top: 0px;
    left: -10px;
  }
  
  /* Hide default Divi mobile menu */
  #et_mobile_nav_menu {
    display: none !important;
  }
  
  /* Container for our custom menu */
  .et_mobile_menu_container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
  }
  
  /* Hamburger button styling */
  .custom-mobile-toggle {
    position: relative;
    width: 50px;
    height: 50px;
    background: white;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    border: none;
    outline: none;
  }
  
  .custom-mobile-toggle:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
  }
  
  /* Hamburger lines */
  .hamburger-lines {
    position: relative;
    width: 20px;
    height: 14px;
  }
  
  .hamburger-lines span {
    display: block;
    height: 2px;
    width: 100%;
    background: #216CCE;
    border-radius: 1px;
    position: absolute;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  }
  
  .hamburger-lines span:nth-child(1) {
    top: 0;
  }
  
  .hamburger-lines span:nth-child(2) {
    top: 6px;
  }
  
  .hamburger-lines span:nth-child(3) {
    top: 12px;
  }
  
  /* Animated hamburger to X */
  .menu-open .hamburger-lines span:nth-child(1) {
    transform: rotate(45deg);
    top: 6px;
  }
  
  .menu-open .hamburger-lines span:nth-child(2) {
    opacity: 0;
    transform: translateX(20px);
  }
  
  .menu-open .hamburger-lines span:nth-child(3) {
    transform: rotate(-45deg);
    top: 6px;
  }
  
  /* Menu overlay */
  .custom-mobile-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #216CCE;
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transform: scale(0);
    transform-origin: calc(100% - 45px) 45px; /* Center on hamburger button */
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    border-radius: 50%;
  }
  
  .menu-open .custom-mobile-menu {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
    border-radius: 0;
  }
  
  /* Menu items container */
  .custom-menu-items {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    width: 100%;
    max-width: 300px;
    opacity: 0;
    transition: opacity 0.3s ease 0.1s;
  }
  
  .menu-open .custom-menu-items {
    opacity: 1;
    transition-delay: 0.2s;
  }
  
  /* Individual menu items */
  .custom-menu-item {
    margin: 0;
    padding: 0;
    list-style: none;
    transform: translateY(30px);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  }
  
  .menu-open .custom-menu-item {
    transform: translateY(0);
  }
  
  /* Stagger animation for menu items */
  .menu-open .custom-menu-item:nth-child(1) { transition-delay: 0.3s; }
  .menu-open .custom-menu-item:nth-child(2) { transition-delay: 0.35s; }
  .menu-open .custom-menu-item:nth-child(3) { transition-delay: 0.4s; }
  .menu-open .custom-menu-item:nth-child(4) { transition-delay: 0.45s; }
  .menu-open .custom-menu-item:nth-child(5) { transition-delay: 0.5s; }
  .menu-open .custom-menu-item:nth-child(6) { transition-delay: 0.55s; }
  
  .custom-menu-item a {
    display: block;
    padding: 15px 20px;
    color: #fff;
    text-decoration: none;
    font-size: 23px;
    font-weight: 900;
    border-radius: 8px;
    margin: 8px 0;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
  }
  
  .custom-menu-item a::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(33, 108, 206, 0.1), transparent);
    transition: left 0.5s ease;
  }
  
  .custom-menu-item a:hover::before {
    left: 100%;
  }
  
  .custom-menu-item a:hover {
    background: rgba(33, 108, 206, 0.05);
    transform: translateX(5px);
    color: #fff;
  }
  
  /* Close button styling */
  .custom-close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: #216CCE;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    opacity: 0;
    transform: scale(0.8);
  }
  
  .menu-open .custom-close-btn {
    opacity: 1;
    transform: scale(1);
    transition-delay: 0.2s;
  }
  
  .custom-close-btn:hover {
    background: #1a5ba8;
    transform: scale(1.1);
  }
  
  .custom-close-btn::before,
  .custom-close-btn::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 2px;
    background: white;
    border-radius: 1px;
  }
  
  .custom-close-btn::before {
    transform: rotate(45deg);
  }
  
  .custom-close-btn::after {
    transform: rotate(-45deg);
  }
  
  /* Prevent scrolling when menu is open */
  body.menu-open {
    overflow: hidden;
  }
  
  /* Backdrop blur effect */
  .custom-mobile-menu::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    backdrop-filter: blur(10px);
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
  }
  
  .menu-open .custom-mobile-menu::before {
    opacity: 0.1;
  }
  
  /* Pulse animation for hamburger */
  @keyframes pulse {
    0% { box-shadow: 0 2px 10px rgba(0,0,0,0.1), 0 0 0 0 rgba(33, 108, 206, 0.4); }
    70% { box-shadow: 0 2px 10px rgba(0,0,0,0.1), 0 0 0 10px rgba(33, 108, 206, 0); }
    100% { box-shadow: 0 2px 10px rgba(0,0,0,0.1), 0 0 0 0 rgba(33, 108, 206, 0); }
  }
  
  .custom-mobile-toggle:focus {
    animation: pulse 1.5s infinite;
  }
  
  /* Micro-interaction for menu items */
  .custom-menu-item a {
    position: relative;
  }
  
  .custom-menu-item a::after {
    content: '';
    position: absolute;
    bottom: 8px;
    left: 50%;
    width: 0;
    height: 2px;
    background: #216CCE;
    transition: all 0.3s ease;
    transform: translateX(-50%);
  }
  
  .custom-menu-item a:hover::after {
    width: 30px;
  }
  
  /* Loading state */
  .custom-mobile-toggle.loading {
    pointer-events: none;
  }
  
  .custom-mobile-toggle.loading .hamburger-lines span {
    animation: loading 1s ease-in-out infinite;
  }
  
  @keyframes loading {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
  }
}