/**
 * InvestHub Common Styles
 * Shared styles for all templates
 */

/* ============================================
   CSS Reset & Base Styles
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    overflow-x: hidden;
    max-width: 100vw;
}

/* ============================================
   CSS Variables / Design Tokens
   ============================================ */
:root {
    /* Background Colors */
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-tertiary: #1a1a24;
    --bg-card: #16161f;

    /* Accent Colors */
    --accent: #a855f7;
    --accent-hover: #9333ea;
    --accent-glow: rgba(168, 85, 247, 0.3);
    --accent-purple: #a855f7;
    --accent-pink: #ec4899;

    /* Status Colors */
    --success: #22c55e;
    --success-glow: rgba(34, 197, 94, 0.3);
    --warning: #eab308;
    --error: #ef4444;

    /* Text Colors */
    --text-primary: #ffffff;
    --text-secondary: #a1a1aa;
    --text-muted: #71717a;

    /* Border & Dividers */
    --border-color: rgba(255,255,255,0.1);

    /* Gradients */
    --gradient-purple: linear-gradient(135deg, #a855f7 0%, #ec4899 100%);
    --gradient-green: linear-gradient(90deg, #22c55e, #16a34a, #22c55e);
    --gradient-dark: linear-gradient(180deg, #0a0a0f 0%, #12121a 100%);

    /* Layout */
    --sidebar-width: 280px;
}

/* ============================================
   Typography & Base Elements
   ============================================ */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    position: relative;
}

/* Override WordPress default heading colors */
h1, h2, h3, h4, h5, h6 {
    color: var(--text-primary) !important;
}

/* Fix emoji sizing (disable WordPress twemoji) */
img.emoji, img.wp-smiley {
    height: 1em !important;
    width: 1em !important;
    margin: 0 0.05em 0 0.1em !important;
    vertical-align: -0.1em !important;
    border: none !important;
    box-shadow: none !important;
    display: inline !important;
}

/* ============================================
   Global Ambient Effects
   ============================================ */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(ellipse 80% 50% at 20% 20%, rgba(168, 85, 247, 0.12) 0%, transparent 50%),
        radial-gradient(ellipse 60% 40% at 80% 30%, rgba(236, 72, 153, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse 70% 50% at 10% 80%, rgba(168, 85, 247, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse 50% 30% at 90% 70%, rgba(236, 72, 153, 0.05) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

/* Animated floating orbs */
.ih-ambient-orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(80px);
    pointer-events: none;
    z-index: 0;
    animation: float 20s ease-in-out infinite;
}

.ih-orb-1 {
    width: 600px;
    height: 600px;
    background: rgba(168, 85, 247, 0.15);
    top: -10%;
    right: -10%;
    animation-delay: 0s;
}

.ih-orb-2 {
    width: 400px;
    height: 400px;
    background: rgba(236, 72, 153, 0.1);
    bottom: 20%;
    left: -5%;
    animation-delay: -7s;
}

.ih-orb-3 {
    width: 500px;
    height: 500px;
    background: rgba(168, 85, 247, 0.08);
    top: 50%;
    right: -15%;
    animation-delay: -14s;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(30px, -30px) scale(1.05); }
    50% { transform: translate(-20px, 20px) scale(0.95); }
    75% { transform: translate(20px, 30px) scale(1.02); }
}

/* ============================================
   Header Navigation
   ============================================ */
.ih-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 16px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(10, 10, 15, 0.25);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: none;
}

.ih-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.ih-logo img {
    height: 40px;
}

.ih-logo-text {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

.ih-nav {
    display: flex;
    gap: 24px;
    align-items: center;
}

.ih-nav a {
    color: #e5e7eb;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.2s;
    white-space: nowrap;
}

.ih-nav a:hover {
    color: #fff;
}

.ih-nav-highlight {
    color: #f59e0b !important;
    font-weight: 600 !important;
    -webkit-text-fill-color: #f59e0b;
}

.ih-nav-highlight:hover {
    color: #fbbf24 !important;
    -webkit-text-fill-color: #fbbf24;
}

/* Mobile nav highlight - orange color */
.ih-mobile-nav .ih-nav-highlight {
    color: #f59e0b !important;
    -webkit-text-fill-color: #f59e0b;
}

.ih-mobile-nav .ih-nav-highlight:hover {
    color: #fbbf24 !important;
    -webkit-text-fill-color: #fbbf24;
}

/* Header CTA Button - Green */
.ih-nav .ih-btn-header,
.ih-btn-header {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%) !important;
    color: #fff !important;
    -webkit-text-fill-color: #fff !important;
    padding: 10px 20px !important;
    border-radius: 8px !important;
    font-weight: 600 !important;
    transition: all 0.2s !important;
    text-decoration: none !important;
}

.ih-nav .ih-btn-header:hover,
.ih-btn-header:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(34, 197, 94, 0.4);
    color: #fff !important;
}

/* Language Switcher in Header */
.ih-lang-switcher-inline {
    color: #d1d5db !important;
    text-decoration: none !important;
    font-size: 14px !important;
    padding: 8px 16px !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    border-radius: 8px !important;
    transition: all 0.2s !important;
    font-weight: 500 !important;
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
}

.ih-lang-switcher-inline:hover {
    color: #fff !important;
    border-color: rgba(255, 255, 255, 0.3) !important;
    background: rgba(255, 255, 255, 0.05) !important;
}

/* Navigation Dropdown - Matching referral page style */
.ih-nav-dropdown {
    position: relative !important;
    display: inline-block !important;
}

.ih-nav-dropdown-toggle,
button.ih-nav-dropdown-toggle,
.ih-nav button.ih-nav-dropdown-toggle {
    background: none !important;
    background-color: transparent !important;
    border: none !important;
    border-width: 0 !important;
    outline: none !important;
    box-shadow: none !important;
    color: #e5e7eb !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    cursor: pointer !important;
    padding: 0 !important;
    margin: 0 !important;
    font-family: inherit !important;
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    transition: color 0.2s !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
}

.ih-nav-dropdown-toggle:hover {
    color: #fff !important;
}

.ih-nav-dropdown-toggle:focus,
.ih-nav-dropdown-toggle:active,
button.ih-nav-dropdown-toggle:focus,
button.ih-nav-dropdown-toggle:active {
    outline: none !important;
    border: none !important;
    box-shadow: none !important;
}

/* CSS arrow instead of text symbol */
.ih-nav-arrow {
    display: inline-block !important;
    width: 0 !important;
    height: 0 !important;
    border-left: 4px solid transparent !important;
    border-right: 4px solid transparent !important;
    border-top: 4px solid currentColor !important;
    transition: transform 0.2s !important;
    font-size: 0 !important;
    line-height: 0 !important;
}

.ih-nav-dropdown:hover .ih-nav-arrow {
    transform: rotate(180deg) !important;
}

.ih-nav-dropdown-menu {
    position: absolute !important;
    top: 100% !important;
    left: 0 !important;
    transform: none !important;
    margin-top: 10px !important;
    padding: 6px 0 !important;
    background: #1a1a1f !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-radius: 8px !important;
    min-width: 170px !important;
    opacity: 0 !important;
    visibility: hidden !important;
    transition: all 0.15s !important;
    z-index: 200 !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5) !important;
}

/* Remove the ::before pseudo-element */
.ih-nav-dropdown-menu::before {
    display: none !important;
}

.ih-nav-dropdown:hover .ih-nav-dropdown-menu {
    opacity: 1 !important;
    visibility: visible !important;
    margin-top: 6px !important;
}

.ih-nav-dropdown-menu a {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 10px 16px !important;
    margin-top: 0 !important;
    color: #d1d5db !important;
    text-decoration: none !important;
    font-size: 14px !important;
    font-weight: 400 !important;
    transition: all 0.15s !important;
    position: relative !important;
    z-index: 1 !important;
}

.ih-nav-dropdown-menu a:first-child {
    margin-top: 0 !important;
}

.ih-nav-dropdown-menu a:last-child {
    margin-bottom: 0 !important;
}

.ih-nav-dropdown-menu a:hover {
    color: #fff !important;
    background: rgba(139, 92, 246, 0.15) !important;
}

.ih-nav-dropdown-label {
    display: block !important;
    padding: 10px 16px !important;
    color: var(--text-muted) !important;
    font-size: 14px !important;
    cursor: default !important;
    position: relative !important;
    z-index: 1 !important;
}

/* Nested submenu in dropdown - matching referral page */
.ih-nav-submenu {
    position: relative !important;
    z-index: 1 !important;
}

.ih-nav-submenu-header {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 10px 16px !important;
    color: #d1d5db !important;
    font-size: 14px !important;
    font-weight: 400 !important;
    text-decoration: none !important;
    transition: all 0.15s !important;
    cursor: pointer !important;
}

.ih-nav-submenu-header:hover {
    color: #fff !important;
    background: rgba(139, 92, 246, 0.15) !important;
}

.ih-submenu-arrow {
    font-size: 16px !important;
    color: #9ca3af !important;
    transition: transform 0.2s !important;
}

.ih-nav-submenu:hover .ih-submenu-arrow {
    transform: none !important;
}

/* Flyout submenu to the right */
.ih-nav-submenu-items {
    position: absolute !important;
    left: 100% !important;
    top: 0 !important;
    background: #1a1a1f !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-radius: 8px !important;
    padding: 6px 0 !important;
    min-width: 200px !important;
    opacity: 0 !important;
    visibility: hidden !important;
    transition: all 0.15s !important;
    margin-left: 4px !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5) !important;
    display: block !important;
}

.ih-nav-submenu:hover .ih-nav-submenu-items {
    opacity: 1 !important;
    visibility: visible !important;
    margin-left: 0 !important;
}

.ih-nav-submenu-items a {
    padding: 10px 16px !important;
    font-size: 14px !important;
    font-weight: 400 !important;
    display: block !important;
    color: #d1d5db !important;
}

.ih-nav-submenu-items a:hover {
    color: #fff !important;
    background: rgba(139, 92, 246, 0.15) !important;
}

/* Keep dropdown open when hovering submenu items */
.ih-nav-dropdown-menu:hover {
    opacity: 1 !important;
    visibility: visible !important;
}

/* Mobile submenu */
.ih-mobile-submenu {
    padding-left: 16px !important;
    border-left: 2px solid rgba(168, 85, 247, 0.3) !important;
    margin: 8px 0 8px 16px !important;
}

.ih-mobile-submenu-label {
    display: block !important;
    color: var(--text-muted) !important;
    font-size: 12px !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    margin-bottom: 8px !important;
    padding: 0 !important;
}

.ih-mobile-submenu a {
    display: block !important;
    padding: 8px 0 !important;
    font-size: 15px !important;
}

/* Language Switcher - Desktop inline version */
.ih-lang-switch {
    background: rgba(255,255,255,0.1) !important;
    padding: 6px 12px !important;
    border-radius: 6px !important;
    font-size: 13px !important;
    transition: all 0.2s !important;
    white-space: nowrap !important;
}

.ih-lang-switch:hover {
    background: rgba(255,255,255,0.2) !important;
    color: #fff !important;
}

/* Mobile language switcher - hidden on desktop, shown on mobile */
.ih-lang-mobile {
    display: none;
    font-size: 20px;
    text-decoration: none;
    padding: 8px;
    border-radius: 6px;
    background: rgba(255,255,255,0.1);
    transition: all 0.2s;
    margin-right: 8px;
    flex-shrink: 0;
    line-height: 1;
}

.ih-lang-mobile:hover {
    background: rgba(255,255,255,0.2);
}

/* Header Buttons */
.ih-btn-header {
    background: linear-gradient(90deg, #22c55e, #16a34a, #22c55e);
    background-size: 200% 100%;
    color: #ffffff !important;
    padding: 10px 24px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: transform 0.2s, box-shadow 0.2s;
    animation: shimmer 2s ease-in-out infinite;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

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

.ih-btn-header:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(34, 197, 94, 0.4);
    color: #ffffff !important;
}

/* ============================================
   Mobile Menu / Burger
   ============================================ */

/* Mobile controls container (language + burger) */
.ih-mobile-controls {
    display: none;
    align-items: center;
    gap: 4px;
}

.ih-burger {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 8px;
    z-index: 101;
}

.ih-burger span {
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    transition: all 0.3s;
}

.ih-burger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.ih-burger.active span:nth-child(2) {
    opacity: 0;
}

.ih-burger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

.ih-mobile-nav {
    display: none;
    position: fixed;
    top: 72px;
    left: 0;
    right: 0;
    bottom: 0;
    background: #0f0f13;
    z-index: 99;
    flex-direction: column;
    padding: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.ih-mobile-nav.active {
    display: flex;
}

.ih-mobile-nav a {
    display: block;
    width: 100%;
    padding: 18px 24px;
    color: #e5e7eb;
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    transition: background 0.2s;
}

.ih-mobile-nav a:hover {
    background: rgba(255, 255, 255, 0.03);
}

.ih-mobile-nav .ih-mobile-gift {
    background: linear-gradient(135deg, var(--accent) 0%, #ec4899 100%);
    color: white !important;
    border-radius: 12px;
    padding: 16px 20px;
    margin: 16px 0;
    text-align: center;
    border-bottom: none;
    font-weight: 600;
}

.ih-mobile-nav .ih-btn-header {
    margin-top: 16px;
    padding: 14px 32px;
    font-size: 16px;
    width: 100%;
    text-align: center;
    border-bottom: none;
    display: block;
}

/* Mobile section label */
.ih-mobile-section-label {
    width: 100%;
    padding: 16px 20px 8px;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: none;
    margin-top: 8px;
}

.ih-mobile-label {
    display: block;
    width: 100%;
    padding: 12px 20px;
    color: var(--text-muted);
    font-size: 14px;
    border-bottom: 1px solid var(--border-color);
}

/* ============================================
   Mobile Dropdown / Accordion
   ============================================ */
.ih-mobile-dropdown {
    width: 100%;
}

.ih-mobile-dropdown-toggle {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 18px 24px;
    background: none;
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    color: #e5e7eb;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    text-align: left;
    transition: background 0.2s;
}

.ih-mobile-dropdown-toggle:hover {
    background: rgba(255, 255, 255, 0.03);
}

/* CSS arrow for accordion */
.ih-mobile-dropdown-toggle::after {
    content: '';
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid #9ca3af;
    transition: transform 0.2s;
    flex-shrink: 0;
}

/* Hide the SVG arrow when CSS arrow is used */
.ih-mobile-dropdown-toggle svg {
    display: none;
}

.ih-mobile-dropdown.active .ih-mobile-dropdown-toggle::after {
    transform: rotate(180deg);
}

.ih-mobile-dropdown-menu {
    display: none !important;
    flex-direction: column;
    background: rgba(0, 0, 0, 0.2);
}

.ih-mobile-dropdown.active .ih-mobile-dropdown-menu {
    display: flex !important;
}

.ih-mobile-dropdown-menu a {
    padding: 14px 24px 14px 40px !important;
    font-size: 15px !important;
    color: #9ca3af !important;
    border-bottom: none !important;
}

.ih-mobile-dropdown-menu a:hover {
    color: #fff !important;
    background: rgba(255, 255, 255, 0.03) !important;
}

/* ============================================
   Responsive Design
   ============================================ */

/* Desktop nav visible at 1024px and above */
@media (min-width: 1024px) {
    .ih-nav {
        display: flex !important;
    }
    .ih-mobile-controls {
        display: none !important;
    }
}

/* Mobile nav below 1024px */
@media (max-width: 1023px) {
    .ih-header {
        padding: 12px 16px !important;
    }

    .ih-nav {
        display: none !important;
    }

    /* Show mobile controls container */
    .ih-mobile-controls {
        display: flex !important;
    }

    .ih-burger {
        display: flex !important;
    }

    .ih-lang-mobile {
        display: flex !important;
        align-items: center;
        justify-content: center;
    }

    .ih-logo-text {
        font-size: 18px !important;
    }
}
