/**
 * Header and Global Theme Layout Styles
 * Astra Child Theme
 */

/* ────────── Global Theme Variables (Light Theme Default) ────────── */
:root,
html,
html[data-theme="light"] {
    --wps-primary: #10b981;
    --wps-primary-hover: #059669;
    --wps-bg: #f8fafc;
    --wps-header-bg: #ffffff;
    --wps-footer-bg: #f8fafc;
    --wps-card-bg: #ffffff;
    --wps-card-bg-hover: #f1f5f9;
    --wps-border: #e2e8f0;
    --wps-border-light: #f1f5f9;
    --wps-text: #0f172a;
    --wps-text-muted: #64748b;
    --wps-text-light: #94a3b8;
    --wps-input-bg: #ffffff;
    --wps-icon-bg: #f1f5f9;
}

html[data-theme="dark"] {
    --wps-primary: #10b981;
    --wps-primary-hover: #059669;
    --wps-bg: #060b14;
    --wps-header-bg: #0b1329;
    --wps-footer-bg: #040812;
    --wps-card-bg: #0d172e;
    --wps-card-bg-hover: #132244;
    --wps-border: rgba(255, 255, 255, 0.1);
    --wps-border-light: rgba(255, 255, 255, 0.06);
    --wps-text: #f8fafc;
    --wps-text-muted: #94a3b8;
    --wps-text-light: #64748b;
    --wps-input-bg: #0d172e;
    --wps-icon-bg: #132244;
}

/* Apply global dark background across all pages */
html,
body,
.site,
.site-content,
#page,
#content,
.ast-container,
.main-header-bar {
    background-color: var(--wps-bg) !important;
    color: var(--wps-text) !important;
}

/* Custom Header Styles */
.wps-custom-header {
    background: var(--wps-header-bg);
    border-bottom: 1px solid var(--wps-border);
    padding: 0 20px;
    font-family: 'Mona Sans', sans-serif;
    position: sticky;
    top: 0;
    z-index: 999;
    transition: background 0.3s ease, border-color 0.3s ease;
}

.wps-header-container {
    max-width: 1400px;
    margin: 0 auto;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Brand Logo */
.wps-header-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.wps-header-brand img.custom-logo,
.wps-footer-brand img.custom-logo {
    max-height: 50px;
    width: auto;
}

.wps-header-logo-icon {
    color: #10b981;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wps-header-brand-text {
    display: flex;
    flex-direction: column;
}

.wps-header-title {
    font-family: 'Mona Sans', sans-serif;
    font-weight: 800;
    font-size: 1.25rem;
    line-height: 1.1;
    color: var(--wps-text, #0f172a);
    letter-spacing: 0.5px;
}

.wps-header-title span {
    color: #10b981;
}

.wps-header-tagline {
    font-size: 0.8rem;
    color: var(--wps-text-muted, #64748b);
    font-weight: 400;
    margin-top: 2px;
    letter-spacing: 0px;
    font-family: 'Mona Sans', sans-serif;
}

/* Navigation (Desktop) */
.wps-header-nav {
    display: flex;
    gap: 22px;
    align-items: center;
}

.wps-header-nav a {
    color: var(--wps-text);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.25s ease;
    padding: 6px 12px;
    border-radius: 8px;
}

.wps-header-nav a i {
    font-size: 1rem;
    color: #10b981;
    transition: transform 0.2s ease;
}

.wps-header-nav a:hover {
    color: #10b981;
    background: rgba(16, 185, 129, 0.12);
}

.wps-header-nav a:hover i {
    transform: scale(1.15);
}

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

.wps-search-icon {
    background: var(--wps-card-bg-hover, #f1f5f9);
    border: 1px solid var(--wps-border, #e2e8f0);
    color: var(--wps-text, #0f172a);
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.3s;
    height: 40px;
    width: 40px;
}

.wps-search-icon i {
    font-size: 1rem;
}

.wps-search-icon:hover {
    border-color: #10b981;
    color: #10b981;
    background: rgba(16, 185, 129, 0.1);
}

.wps-btn-signin {
    color: var(--wps-text, #0f172a);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    padding: 10px 20px;
    border-radius: 8px;
    border: 1px solid var(--wps-border, #e2e8f0);
    transition: all 0.3s;
    white-space: nowrap;
    background: var(--wps-card-bg-hover, #f1f5f9);
}

.wps-btn-signin:hover {
    border-color: #10b981;
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.wps-btn-join {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #ffffff !important;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.95rem;
    padding: 10px 24px;
    border-radius: 8px;
    transition: all 0.3s;
    white-space: nowrap;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.25);
}

.wps-btn-join:hover {
    background: linear-gradient(135deg, #34d399 0%, #059669 100%);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

/* Mobile Menu Toggle Button (Hidden on Desktop) */
.wps-mobile-toggle-btn {
    display: none;
    background: var(--wps-card-bg-hover, #f1f5f9);
    border: 1px solid var(--wps-border, #e2e8f0);
    border-radius: 8px;
    color: var(--wps-text, #0f172a);
    cursor: pointer;
    padding: 8px;
    height: 40px;
    width: 40px;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.wps-mobile-toggle-btn i {
    font-size: 1.25rem;
}

.wps-mobile-toggle-btn:hover {
    border-color: #10b981;
    color: #10b981;
    background: rgba(16, 185, 129, 0.1);
}

/* Responsive for Tablet / Mobile (max-width: 1024px) */
@media (max-width: 1024px) {
    .wps-header-nav {
        display: none !important;
    }

    .wps-mobile-toggle-btn {
        display: flex !important;
    }

    .wps-header-actions .wps-btn-signin,
    .wps-header-actions .wps-btn-join {
        display: none;
    }
}

/* ────────── Mobile Left-Side Drawer (Dark Theme) ────────── */
.wps-mobile-drawer-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(2, 6, 23, 0.75);
    backdrop-filter: blur(6px);
    z-index: 99998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.wps-mobile-drawer-backdrop.wps-open {
    opacity: 1;
    visibility: visible;
}

.wps-mobile-drawer {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 330px;
    max-width: 86vw;
    background: #0b1329;
    color: #f8fafc;
    border-right: 1px solid var(--wps-border);
    box-shadow: 10px 0 35px rgba(0, 0, 0, 0.5);
    z-index: 99999;
    display: flex;
    flex-direction: column;
    transform: translateX(-100%);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.35s ease;
    visibility: hidden;
    box-sizing: border-box;
}

.wps-mobile-drawer.wps-open {
    transform: translateX(0);
    visibility: visible;
}

/* Drawer Header */
.wps-mobile-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--wps-border);
    background: #0b1329;
}

.wps-mobile-drawer-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.wps-mobile-drawer-close {
    background: transparent;
    border: none;
    color: var(--wps-text-muted);
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    transition: all 0.2s;
}

.wps-mobile-drawer-close:hover {
    color: #10b981;
    background: var(--wps-card-bg-hover);
}

/* Drawer Body */
.wps-mobile-drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px 0;
}

/* Drawer Menu Links */
.wps-mobile-menu {
    display: flex;
    flex-direction: column;
    padding: 0 12px;
    gap: 4px;
}

.wps-mobile-menu a {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    color: var(--wps-text);
    text-decoration: none;
    font-size: 1.05rem;
    font-weight: 500;
    font-family: 'Mona Sans', sans-serif;
    border-radius: 10px;
    transition: all 0.2s ease;
}

.wps-mobile-menu a i {
    color: #10b981;
    font-size: 1.15rem;
    width: 22px;
    text-align: center;
}

.wps-mobile-menu a:hover {
    background: #132244;
    color: #10b981;
    padding-left: 20px;
}

/* Contact Details in Drawer */
.wps-mobile-contact-section {
    margin: 25px 20px 0;
    padding-top: 20px;
    border-top: 1px solid var(--wps-border);
}

.wps-mobile-section-title {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--wps-text-muted);
    margin-bottom: 15px;
}

.wps-mobile-contact-item {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    font-size: 0.9rem;
    color: var(--wps-text);
}

.wps-mobile-contact-item i {
    color: #10b981;
    font-size: 1rem;
    width: 20px;
    text-align: center;
}

.wps-mobile-contact-item a {
    color: var(--wps-text);
    text-decoration: none;
    transition: color 0.2s;
}

.wps-mobile-contact-item a:hover {
    color: #10b981;
}

/* Drawer Footer */
.wps-mobile-drawer-footer {
    padding: 18px 20px;
    border-top: 1px solid var(--wps-border);
    background: #080e1c;
}

.wps-mobile-auth-buttons {
    display: flex;
    gap: 10px;
    width: 100%;
}

.wps-mobile-user-card {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    padding: 6px 0;
}

/* Hide drawer elements completely on desktop */
@media (min-width: 1025px) {

    .wps-mobile-drawer,
    .wps-mobile-drawer-backdrop {
        display: none !important;
    }
}

/* Search Overlay (Dark Mode) */
.wps-search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(2, 6, 23, 0.85);
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.wps-search-overlay.wps-show {
    opacity: 1;
    visibility: visible;
}

.wps-search-close {
    position: absolute;
    top: 30px;
    right: 40px;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 3rem;
    cursor: pointer;
    line-height: 1;
    transition: color 0.3s;
}

.wps-search-close:hover {
    color: #10b981;
}

.wps-search-form {
    width: 100%;
    max-width: 800px;
    position: relative;
}

#wps-search-overlay .wps-search-input {
    width: 100%;
    background: #ffffff !important;
    background-color: #ffffff !important;
    border: 2px solid #00c06d !important;
    border-radius: 50px !important;
    color: #1e293b !important;
    font-size: 1.2rem !important;
    padding: 14px 60px 14px 28px !important;
    margin: 0 !important;
    height: auto !important;
    line-height: 1.5 !important;
    font-family: 'Mona Sans', sans-serif;
    outline: none !important;
    box-shadow: 0 4px 20px rgba(0, 192, 109, 0.15) !important;
    transition: all 0.3s ease;
}

#wps-search-overlay .wps-search-input::placeholder {
    color: #94a3b8 !important;
}

#wps-search-overlay .wps-search-input:focus {
    border-color: #00a860 !important;
    box-shadow: 0 0 0 4px rgba(0, 192, 109, 0.25), 0 8px 30px rgba(0, 192, 109, 0.2) !important;
}

.wps-search-submit {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: #0ba866 !important;
    border: none;
    color: #ffffff !important;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 40px;
    padding: 10px 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.wps-search-submit:hover {
    background: #099258 !important;
    transform: translateY(-50%) scale(1.02);
}

/* ── Live Search Suggestions Card (Matches Clean White & Mint Pill Design) ── */
.wps-search-suggestions {
    position: absolute !important;
    top: calc(100% + 10px) !important;
    left: 0 !important;
    right: 0 !important;
    background: #ffffff !important;
    border: 1px solid rgba(0, 0, 0, 0.08) !important;
    border-radius: 16px !important;
    max-height: 420px !important;
    overflow-y: auto !important;
    box-shadow: 0 15px 35px -5px rgba(0, 0, 0, 0.1), 0 5px 15px -3px rgba(0, 0, 0, 0.05) !important;
    display: none !important;
    z-index: 999999 !important;
    text-align: left !important;
    padding: 6px 0 !important;
}

.wps-search-suggestions.wps-active {
    display: block !important;
}

.wps-suggestion-item {
    display: flex !important;
    align-items: center !important;
    padding: 12px 20px !important;
    color: #1e293b !important;
    text-decoration: none !important;
    border-bottom: 1px solid #f1f5f9 !important;
    background: #ffffff !important;
    transition: background 0.15s ease !important;
}

.wps-suggestion-item:last-child {
    border-bottom: none !important;
}

.wps-suggestion-item:hover {
    background: #f8fafc !important;
}

/* Image Thumbnail Container */
.wps-suggestion-thumb-wrap {
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    background: #fdf5ec !important;
    border-radius: 12px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin-right: 16px !important;
    overflow: hidden !important;
    border: 1px solid rgba(0, 0, 0, 0.04) !important;
}

.wps-suggestion-thumb {
    width: 32px !important;
    height: 32px !important;
    object-fit: contain !important;
    display: block !important;
}

/* Item Title */
.wps-suggestion-title {
    font-size: 1.05rem !important;
    font-weight: 500 !important;
    color: #1e293b !important;
    font-family: 'Mona Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
    flex: 1 !important;
    padding-right: 15px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

/* Category / Type Pill Badge (Light Mint Background, Deep Green Text) */
.wps-suggestion-type {
    margin-left: auto !important;
    font-size: 0.85rem !important;
    background: #e8faf1 !important;
    color: #0ba866 !important;
    padding: 5px 16px !important;
    border-radius: 30px !important;
    font-weight: 600 !important;
    letter-spacing: 0.2px !important;
    white-space: nowrap !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border: 1px solid rgba(11, 168, 102, 0.15) !important;
}

.wps-suggestion-loading {
    padding: 20px !important;
    color: #64748b !important;
    font-style: italic !important;
    text-align: center !important;
    background: #ffffff !important;
}

.wps-suggestion-empty {
    padding: 20px !important;
    color: #ef4444 !important;
    text-align: center !important;
    font-weight: 500 !important;
    background: #ffffff !important;
}