/* ==================== VARIABLES ==================== */
:root {
    /* Colors - Spain Executive Palette */
    --primary: #0a2540;
    --primary-bright: #635bff;
    --accent: #ef4444;
    --text-main: #1a1f36;
    --text-muted: #4f566b;
    --text-white: #ffffff;
    --bg-white: #ffffff;
    --bg-alt: #f7fafc;
    --border: #e3e8ee;

    /* Dark Mode Defaults */
    --bg-dark: #0a0a18;
    --bg-dark-alt: #16162a;
    --border-dark: #2d2d44;

    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3.5rem;
    --spacing-2xl: 6rem;

    /* Typography */
    --font-heading: 'Playfair Display', serif;
    --font-sans: 'Outfit', sans-serif;
    --transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    --bg-main: rgba(255, 255, 255, 0.05);
    --shadow-glow: 0 0 20px rgba(99, 91, 255, 0.4);
}

/* Dark Mode Overrides */
body.dark-mode {
    --bg-white: var(--bg-dark);
    --bg-alt: var(--bg-dark-alt);
    --text-main: #f9f9ff;
    --text-muted: #a0aec0;
    --border: var(--border-dark);
    --bg-main: rgba(255, 255, 255, 0.05);
}

/* ==================== BASE STYLES ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-white);
    color: var(--text-main);
    line-height: 1.6;
    transition: var(--transition);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

img {
    max-width: 100%;
    display: block;
}

/* ==================== HEADER & NAVBAR ==================== */
.header {
    background: rgba(var(--bg-white), 0.85);
    backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--border);
}

.navbar {
    padding: 1.25rem 0;
}

.nav-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo a {
    font-size: 1.7rem;
    font-weight: 800;
    text-decoration: none;
    background: linear-gradient(to right, var(--primary-bright), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-menu {
    display: flex;
    gap: var(--spacing-lg);
    align-items: center;
}

.nav-link {
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 600;
    transition: var(--transition);
}

.nav-link:hover {
    color: var(--primary-bright);
}

/* Dropdown Menu */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
}

.dropdown-toggle i {
    font-size: 0.8rem;
    transition: transform 0.3s ease;
}

[dir="rtl"] .dropdown-toggle i {
    transform: scaleX(-1);
}

.dropdown:hover .dropdown-toggle i {
    transform: rotate(180deg);
}

[dir="rtl"] .dropdown:hover .dropdown-toggle i {
    transform: rotate(180deg) scaleX(-1);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1rem;
    min-width: 220px;
    display: none;
    flex-direction: column;
    gap: 0.5rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    z-index: 1001;
}

.dropdown:hover .dropdown-menu,
.dropdown.active .dropdown-menu {
    display: flex;
}

.dropdown-item {
    text-decoration: none;
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 500;
    padding: 0.5rem;
    border-radius: 6px;
    transition: var(--transition);
}

.dropdown-item:hover {
    background: var(--bg-alt);
    color: var(--primary-bright);
}

.featured-item {
    font-weight: 800 !important;
    color: var(--primary-bright) !important;
}

.nav-controls {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.lang-toggle {
    background: var(--bg-alt);
    border: 1px solid var(--border);
    padding: 5px 12px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 700;
    color: var(--primary-bright);
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 50px;
}

.lang-toggle:hover {
    background: var(--primary-bright);
    color: white;
}

.theme-toggle {
    background: none;
    border: none;
    font-size: 1.4rem;
    cursor: pointer;
    padding: 5px;
}

.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background: var(--text-main);
    border-radius: 2px;
}

/* ==================== HERO SECTION ==================== */
.hero {
    padding: var(--spacing-2xl) 0;
    text-align: center;
    background: radial-gradient(circle at top left, rgba(99, 91, 255, 0.05), transparent),
        radial-gradient(circle at bottom right, rgba(239, 68, 68, 0.05), transparent);
}

.hero-title {
    font-family: var(--font-heading);
    font-size: 4.5rem;
    line-height: 1.1;
    margin-bottom: var(--spacing-md);
    font-weight: 800;
    letter-spacing: -1.5px;
}

.hero-subtitle {
    font-size: 1.4rem;
    color: var(--text-muted);
    max-width: 750px;
    margin: 0 auto var(--spacing-xl);
}

.hero-btns {
    display: flex;
    gap: var(--spacing-sm);
    justify-content: center;
}

.cta-button {
    padding: 1rem 2.5rem;
    border-radius: 12px;
    font-weight: 700;
    font-size: 1.1rem;
    text-decoration: none;
    display: inline-block;
    cursor: pointer;
    transition: var(--transition);
    border: none;
}

.cta-button:not(.secondary) {
    background: var(--primary-bright);
    color: white;
    box-shadow: 0 10px 20px rgba(99, 91, 255, 0.2);
}

.cta-button.secondary {
    background: transparent;
    border: 2px solid var(--border);
    color: var(--text-main);
}

.cta-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 30px rgba(99, 91, 255, 0.3);
}

/* Button & Hub Styling */
.btn-audit,
.hub-button,
.cta-button:not(.secondary) {
    background: linear-gradient(135deg, var(--primary-bright), #8b5cf6) !important;
    color: white !important;
    font-weight: 800 !important;
    box-shadow: var(--shadow-glow) !important;
    border: none !important;
}

.btn-audit:hover,
.hub-button:hover,
.cta-button:not(.secondary):hover {
    transform: scale(1.05);
    box-shadow: 0 0 30px rgba(99, 91, 255, 0.6) !important;
}

/* ==================== SERVICES ==================== */
.services {
    padding: var(--spacing-2xl) 0;
    background-color: var(--bg-alt);
}

.section-title {
    display: block !important;
    margin: 0 auto 3rem auto !important;
    text-align: center;
    font-family: var(--font-heading);
    font-size: 3rem;
    font-weight: 700;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: var(--spacing-lg);
}

.service-card {
    background: var(--bg-white);
    padding: var(--spacing-xl);
    border-radius: 24px;
    border: 1px solid var(--border);
    transition: var(--transition);
}

.service-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.06);
    border-color: var(--primary-bright);
}

.service-icon {
    font-size: 3rem;
    margin-bottom: var(--spacing-md);
}

.service-card h3 {
    margin-bottom: var(--spacing-sm);
    font-size: 1.5rem;
}

.service-card p {
    color: var(--text-muted);
}

/* ==================== STRATEGY ==================== */
.strategy {
    padding: var(--spacing-2xl) 0;
}

.strategy-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-xl);
}

.strategy-card {
    padding: var(--spacing-lg);
    border-left: 4px solid var(--accent);
}

.strategy-card h3 {
    margin-bottom: var(--spacing-sm);
}

.strategy-card p {
    color: var(--text-muted);
}

/* ==================== AEO HUB ==================== */
.aeo-hub {
    padding: var(--spacing-2xl) 0;
    background: var(--bg-alt);
}

.hub-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: var(--spacing-xl);
}

.hub-card {
    background: var(--bg-white);
    padding: var(--spacing-2xl);
    border-radius: 30px;
    text-align: center;
    border: 1px solid var(--border);
}

.hub-icon {
    font-size: 3.5rem;
    margin-bottom: var(--spacing-md);
}

.hub-button {
    margin-top: var(--spacing-lg);
    display: inline-block;
    padding: 0.8rem 2rem;
    border-radius: 50px;
    background: var(--primary);
    color: white;
    text-decoration: none;
    font-weight: 700;
    transition: var(--transition);
}

.hub-button:hover {
    background: var(--primary-bright);
}

/* ==================== FAQ ==================== */
.faq {
    padding: var(--spacing-2xl) 0;
}

.search-box {
    margin-bottom: var(--spacing-xl);
    text-align: center;
}

.search-input {
    width: 100%;
    max-width: 650px;
    padding: 1.2rem 2.5rem;
    border-radius: 100px;
    border: 2px solid var(--border);
    font-size: 1.1rem;
    outline: none;
    background: var(--bg-white);
    color: var(--text-main);
    transition: var(--transition);
}

.search-input:focus {
    border-color: var(--primary-bright);
    box-shadow: 0 0 0 4px rgba(99, 91, 255, 0.1);
}

.faq-list {
    max-width: 850px;
    margin: 0 auto;
}

.faq-item {
    margin-bottom: var(--spacing-sm);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
}

.faq-question {
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-weight: 700;
    font-size: 1.2rem;
    transition: var(--transition);
}

.faq-icon i {
    transition: transform 0.3s ease;
    font-size: 0.9rem;
}

.faq-answer.open+.faq-question .faq-icon i,
.faq-item.active .faq-icon i {
    transform: rotate(180deg);
}

.faq-question:hover {
    background-color: var(--bg-alt);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    padding: 0 2rem;
    transition: var(--transition);
    color: var(--text-muted);
    background: var(--bg-alt);
}

.faq-answer.open {
    max-height: 500px;
    padding: 1.5rem 2rem;
    border-top: 1px solid var(--border);
}

/* ==================== FOOTER ==================== */
.footer {
    background: var(--primary);
    color: white;
    padding: var(--spacing-2xl) 0 var(--spacing-md);
}

.footer-content {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
    gap: var(--spacing-xl);
    margin-bottom: var(--spacing-2xl);
    align-items: flex-start;
}

.footer-section h4 {
    font-size: 1.3rem;
    margin-bottom: var(--spacing-md);
    color: var(--text-white);
}

.footer-section p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.95rem;
}

.footer-section ul,
.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-section li {
    margin-bottom: 0.8rem;
}

.footer-section a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: var(--transition);
}

.footer-section a:hover {
    color: var(--primary-bright);
}

.footer-email-btn {
    margin-top: var(--spacing-md);
    padding: 0.6rem 1.5rem;
    border-radius: 8px;
    background: var(--primary-bright);
    color: white;
    border: none;
    cursor: pointer;
    font-weight: 700;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: var(--spacing-lg);
    text-align: center;
}

.footer-bottom p {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.9rem;
}

/* Footer Category Grid & Bar */
.footer-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2.5rem 3.5rem;
    background: var(--bg-main);
    border-radius: 24px;
    margin-top: 3rem;
    gap: 2rem;
}

.footer-bar-text {
    font-size: 1.2rem;
    font-weight: 600;
}

.resources-grid-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1.5rem;
    list-style: none;
    padding: 0;
}

/* Social Icons */
.social-links {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.social-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: white;
    background: var(--bg-main);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    transition: var(--transition);
}

.social-icon:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-glow);
    border-color: var(--primary-bright);
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    backdrop-filter: blur(8px);
}

.modal-content {
    background: var(--bg-white);
    padding: 3rem;
    border-radius: 30px;
    text-align: center;
    max-width: 450px;
    width: 90%;
    transform: scale(0.8);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: 1px solid var(--border);
}

.modal.active {
    display: flex;
}

.modal.active .modal-content {
    transform: scale(1);
}

.modal-icon {
    font-size: 4rem;
    margin-bottom: 1.5rem;
    display: block;
}

.modal-title {
    font-family: var(--font-heading);
    font-size: 2rem;
    margin-bottom: 1rem;
}

.modal-message {
    color: var(--text-muted);
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 992px) {
    .hero-title {
        font-size: 3.5rem;
    }

    .hub-grid {
        grid-template-columns: 1fr;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }
}

@media (max-width: 768px) {
    .nav-menu {
        display: none;
    }

    .hamburger {
        display: flex;
    }

    .hero-title {
        font-size: 2.8rem;
    }

    .footer-bar {
        flex-direction: column;
        text-align: center;
        padding: 2rem;
        gap: 1.5rem;
    }

    .resources-grid-list {
        grid-template-columns: 1fr;
    }
}