/*
Theme Name: Albaker Theme
Theme URI: https://albakerholding.com
Author: Antigravity
Description: Custom theme for Albaker Holding with Elementor support and Glassmorphism design.
Version: 1.0
Text Domain: albaker-theme
*/

:root {
    /* Brand Colors */
    --brand-dark: #233d4d;
    --brand-light: #ffffff;

    /* Theme Variables (Default Light) */
    --bg-body: #f9f9f9;
    --text-main: #233d4d;
    --glass-bg: rgba(255, 255, 255, 0.25);
    --glass-border: rgba(255, 255, 255, 0.5);
    --glass-blur: 10px;
    --menu-text: #233d4d;
    --menu-bg-hover: rgba(255, 255, 255, 0.4);
    --footer-text: #233d4d;
}

[data-theme="dark"] {
    --bg-body: #121212;
    --text-main: #e0e0e0;
    --glass-bg: rgba(30, 30, 30, 0.6);
    --glass-border: rgba(255, 255, 255, 0.1);
    --menu-text: #ffffff;
    --menu-bg-hover: rgba(255, 255, 255, 0.1);
    --footer-text: #aaaaaa;
}

[data-theme="dark"] body {
    background: #1e283c;
}

/* Dark mode specific overrides */
[data-theme="dark"] .main-navigation a {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.15);
    color: #ffffff;
}

[data-theme="dark"] .main-navigation ul ul {
    background: transparent;
    border: none;
    box-shadow: none;
}

[data-theme="dark"] .main-navigation ul ul a {
    color: #ffffff;
}

[data-theme="dark"] .glass-window {
    background: rgba(30, 30, 30, 0.7);
    border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .glass-button {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

/* Base Styles */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    margin: 0;
    padding: 0;
    color: var(--text-main);
    background: var(--bg-body);
    transition: background 0.3s ease, color 0.3s ease;
    min-height: 100vh;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Glassmorphism Classes */
.glass-element,
.glass-button {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    border-radius: 8px;
    transition: all 0.3s ease;
    color: var(--text-main);
}

.glass-button:hover {
    background: rgba(255, 255, 255, 0.4);
    transform: translateY(-2px);
}

[data-theme="dark"] .glass-button:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* Glassmorphism Content Box */
.glass-window,
.content-box {
    background: rgba(255, 255, 255, 0.12);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 20px;
    padding: 40px 50px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    color: var(--text-main);
    margin: 40px auto;
    max-width: 100%;
}

[data-theme="dark"] .glass-window,
[data-theme="dark"] .content-box {
    background: rgba(30, 30, 30, 0.5);
    border-color: rgba(255, 255, 255, 0.1);
}

/* Contact Box Template */
.contact-box {
    background: rgba(255, 255, 255, 0.15);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 40px 50px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    color: var(--text-main);
    margin: 40px auto;
    max-width: 600px;
    text-align: center;
}

.contact-title {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--text-main);
}

.contact-subtitle {
    font-size: 1rem;
    opacity: 0.9;
    margin-bottom: 30px;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 30px;
}

.contact-item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: 1rem;
}

.contact-icon {
    font-size: 1.2rem;
    opacity: 0.8;
}

.contact-item a {
    color: var(--text-main);
    text-decoration: none;
    transition: opacity 0.3s ease;
}

.contact-item a:hover {
    opacity: 0.7;
}

.social-section {
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.social-title {
    font-size: 0.95rem;
    opacity: 0.9;
    margin-bottom: 15px;
}

.social-icons {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.social-icon {
    color: var(--text-main);
    opacity: 0.8;
    transition: all 0.3s ease;
    padding: 8px;
}

.social-icon:hover {
    opacity: 1;
    transform: translateY(-2px);
}

.social-icon svg {
    width: 28px;
    height: 28px;
}

/* Dark mode contact box */
[data-theme="dark"] .contact-box {
    background: rgba(30, 30, 30, 0.7);
    border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .social-section {
    border-top-color: rgba(255, 255, 255, 0.05);
}

/* Mobile responsive */
@media (max-width: 768px) {
    .contact-box {
        margin: 20px;
        padding: 30px 25px;
    }

    .contact-title {
        font-size: 1.5rem;
    }
}

/* Header */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    padding: 20px 0;
    transition: background 0.3s;
}

.site-header.scrolled {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

[data-theme="dark"] .site-header.scrolled {
    background: rgba(18, 18, 18, 0.9);
}

.site-logo img {
    max-height: 80px;
    width: auto;
}

/* Menu */
.main-navigation ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    gap: 20px;
}

.main-navigation a {
    text-decoration: none;
    color: var(--menu-text);
    font-weight: 700;
    padding: 10px 20px;
    border-radius: 30px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.main-navigation a:hover {
    background: rgba(255, 255, 255, 0.5);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .main-navigation a:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Submenu Styles */
.main-navigation ul li {
    position: relative;
}

.main-navigation ul ul {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    flex-direction: column;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 10px;
    padding-top: 25px;
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--glass-border);
    min-width: 200px;
    z-index: 1000;
    margin-top: 0;
}

/* Invisible bridge to maintain hover when moving to submenu */
.main-navigation ul li.menu-item-has-children::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    height: 20px;
}

.main-navigation ul li:hover>ul {
    display: flex;
}

.main-navigation ul ul li {
    width: 100%;
    margin-bottom: 5px;
}

.main-navigation ul ul li:last-child {
    margin-bottom: 0;
}

.main-navigation ul ul a {
    display: block;
    border-radius: 10px;
    padding: 10px 15px;
    font-size: 0.9em;
}

/* Nested submenus (any level) - display on right side */
.main-navigation .sub-menu .sub-menu {
    top: 0;
    left: 100%;
    margin-top: 0;
    margin-left: 10px;
}

/* Arrow indicator for any menu item with children inside a submenu */
.main-navigation .sub-menu .menu-item-has-children>a::after {
    content: ' ▸';
    font-size: 0.8em;
}

/* Ensure all nested submenus have consistent styling */
.main-navigation .menu-item-has-children>.sub-menu {
    min-width: 180px;
}

/* Footer */
.site-footer {
    padding: 20px 0;
    margin-top: 50px;
    text-align: center;
    background-color: var(--brand-light);
    color: var(--footer-text);
    transition: background-color 0.3s ease, color 0.3s ease;
}

[data-theme="dark"] .site-footer {
    background-color: #1e1e1e;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Theme Toggle Switch */
.theme-switch-wrapper {
    position: fixed;
    top: 25px;
    right: 20px;
    display: flex;
    align-items: center;
    z-index: 9999;
    background: var(--glass-bg);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    padding: 6px;
    border-radius: 30px;
    border: 1px solid var(--glass-border);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.theme-switch {
    position: relative;
    display: inline-block;
    width: 36px;
    height: 20px;
}

.theme-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.theme-switch .slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #e0e0e0, #f5f5f5);
    transition: all 0.4s ease;
    border-radius: 20px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.theme-switch .slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
    background: linear-gradient(135deg, #ffffff, #f0f0f0);
    transition: all 0.4s ease;
    border-radius: 50%;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.theme-switch input:checked+.slider {
    background: linear-gradient(135deg, #2c3e50, #34495e);
}

.theme-switch input:checked+.slider:before {
    transform: translateX(16px);
    background: linear-gradient(135deg, #f1c40f, #f39c12);
}

/* Main Content */
.site-main {
    min-height: calc(100vh - 150px);
}

.entry-content {
    padding: 20px;
}

/* Mobile Menu Toggle Button */
.menu-toggle {
    display: none;
    background: transparent;
    border: none;
    cursor: pointer;
    flex-direction: column;
    gap: 5px;
    padding: 10px;
    z-index: 2000;
}

.menu-toggle .bar {
    width: 25px;
    height: 3px;
    background-color: var(--text-main);
    transition: all 0.3s ease;
    border-radius: 2px;
}

/* Responsive Styles */
@media (max-width: 768px) {
    .menu-toggle {
        display: flex;
    }

    .main-navigation {
        position: fixed;
        top: 0;
        right: -100%;
        width: 70%;
        height: 100vh;
        background: var(--glass-bg);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        padding-top: 80px;
        transition: right 0.3s ease;
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
        z-index: 1500;
    }

    .main-navigation.toggled {
        right: 0;
    }

    .main-navigation ul {
        flex-direction: column;
        align-items: center;
        gap: 20px;
        width: 100%;
    }

    .main-navigation ul li {
        display: flex;
        flex-direction: column;
        align-items: center;
        width: 100%;
    }

    .site-header .container {
        padding: 10px 20px;
    }

    /* Mobile Submenu Fix */
    .main-navigation ul ul {
        position: relative;
        top: 0;
        left: 0;
        width: auto;
        min-width: 200px;
        box-shadow: none;
        background: rgba(255, 255, 255, 0.05);
        margin-top: 10px;
        display: none;
        flex-direction: column;
        align-items: center;
    }

    /* Mobile: Nested submenus display inline below parent, not to the right */
    .main-navigation .sub-menu .sub-menu {
        position: relative;
        top: 0;
        left: 0;
        margin-left: 0;
        margin-top: 10px;
        width: 100%;
    }

    /* Hide arrow on mobile since submenus drop down, not fly out */
    .main-navigation .sub-menu .menu-item-has-children>a::after {
        content: ' ▼';
        font-size: 0.7em;
    }

    /* Show submenu when parent li has 'expanded' class (toggled via JS) */
    .main-navigation ul li.expanded>ul {
        display: flex;
    }

    /* Disable hover-based expansion on mobile */
    .main-navigation ul li:hover>ul {
        display: none;
    }

    .main-navigation ul li.expanded:hover>ul {
        display: flex;
    }

    .glass-window {
        margin: 20px;
        padding: 25px;
        border-radius: 20px;
    }



    /* Dark mode mobile navigation */
    [data-theme="dark"] .main-navigation {
        background: rgba(20, 20, 20, 0.95);
    }

    [data-theme="dark"] .main-navigation ul ul {
        background: rgba(30, 30, 30, 0.8);
    }

    [data-theme="dark"] .main-navigation a {
        color: #ffffff;
        background: rgba(255, 255, 255, 0.05);
        border-color: rgba(255, 255, 255, 0.1);
    }

    [data-theme="dark"] .main-navigation a:hover {
        background: rgba(255, 255, 255, 0.15);
    }

    [data-theme="dark"] .menu-toggle .bar {
        background-color: #ffffff;
    }
}

/* Tablet Responsive Styles */
@media (max-width: 1024px) and (min-width: 769px) {
    .main-navigation ul {
        gap: 10px;
    }

    .main-navigation a {
        padding: 8px 15px;
        font-size: 0.9em;
    }

    .main-navigation ul ul {
        min-width: 180px;
    }

    .main-navigation ul ul a {
        padding: 8px 12px;
        font-size: 0.85em;
    }

    .site-logo img {
        max-height: 60px;
    }
}

/* WordPress Specific Styles */
.wp-block-image img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

.aligncenter {
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.alignleft {
    float: left;
    margin-right: 20px;
}

.alignright {
    float: right;
    margin-left: 20px;
}

/* Elementor Compatibility */
.elementor-section {
    background: transparent !important;
}

.elementor-widget-container {
    padding: 10px;
}

/* Custom Page Template Styles */
.page-template-default .site-main {
    padding-top: 120px;
}

/* Screen Reader Text */
.screen-reader-text {
    border: 0;
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute !important;
    width: 1px;
    word-wrap: normal !important;
}

/* Scroll Up Button */
.scroll-up-btn {
    position: fixed;
    bottom: 30px;
    right: 30px !important;
    left: auto !important;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.8);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    padding: 0;
}

.scroll-up-btn.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.scroll-up-btn:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.4);
}

[data-theme="dark"] .scroll-up-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

@media (max-width: 768px) {
    .scroll-up-btn {
        bottom: 20px;
        right: 20px !important;
        left: auto !important;
        width: 40px;
        height: 40px;
    }
}