/* ==========================================================================
   Global Styles & Variables
   ========================================================================== */

:root {
    /* Colors - Fresh & Vibrant palette */
    --primary-color: #0ea5e9;
    --primary-dark: #0284c7;
    --primary-light: #38bdf8;
    --secondary-color: #10b981;
    --secondary-dark: #059669;
    --accent-color: #f97316;
    --accent-light: #fb923c;

    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --text-light: #9ca3af;

    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --bg-dark: #111827;

    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);

    /* Typography */
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-mono: "SF Mono", Monaco, "Cascadia Code", "Roboto Mono", Consolas, "Courier New", monospace;

    /* Spacing */
    --container-max-width: 1200px;
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
    --spacing-2xl: 4rem;

    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;

    /* Transitions */
    --transition-fast: 150ms ease-in-out;
    --transition-base: 250ms ease-in-out;
}

/* ==========================================================================
   Reset & Base Styles
   ========================================================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    font-family: var(--font-sans);
    color: var(--text-primary);
    background-color: var(--bg-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    margin: 0;
    padding: 0;
}

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

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--primary-dark);
}

/* ==========================================================================
   Layout Utilities
   ========================================================================== */

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

.section-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    text-align: center;
    margin-bottom: var(--spacing-sm);
}

.section-subtitle {
    font-size: 1.125rem;
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: var(--spacing-xl);
}

/* ==========================================================================
   Navigation
   ========================================================================== */

.navbar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(229, 231, 235, 0.6);
    padding: 1.25rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.nav-brand:hover {
    transform: translateY(-2px);
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary-color);
}

.logo-img {
    height: 80px;
    width: 80px;
    display: block;
    transition: transform var(--transition-base), filter var(--transition-base);
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.05));
    aspect-ratio: 1 / 1;
}

.nav-brand:hover .logo-img {
    transform: scale(1.05);
    filter: drop-shadow(0 4px 8px rgba(14, 165, 233, 0.2));
}

@media (max-width: 768px) {
    .logo-img {
        height: 60px;
        width: 60px;
    }
}

.tagline {
    font-size: 1.25rem;
    color: var(--text-primary);
    font-weight: 600;
    line-height: 1.3;
    display: flex;
    flex-direction: column;
    text-align: left;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.nav-toggle span {
    width: 24px;
    height: 2px;
    background-color: var(--text-primary);
    transition: var(--transition-base);
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: var(--spacing-md);
    align-items: center;
}

.nav-menu a {
    color: var(--text-secondary);
    font-weight: 500;
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
    white-space: nowrap;
    display: inline-block;
    position: relative;
}

.nav-menu a:hover {
    color: var(--primary-color);
    transform: translateY(-2px);
}

.nav-menu a.active {
    color: var(--primary-color);
    background-color: rgba(14, 165, 233, 0.08);
}

.nav-menu a.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(14, 165, 233, 0.3);
}

.nav-menu a.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.4);
}

/* Dropdown Menu Styles */
.nav-item-dropdown {
    position: relative;
}

.nav-dropdown-toggle {
    display: flex;
    align-items: center;
}

.nav-dropdown-toggle::after {
    content: '▼';
    font-size: 0.625rem;
    margin-left: 0.375rem;
    transition: transform var(--transition-fast);
}

.nav-item-dropdown:hover .nav-dropdown-toggle::after {
    transform: rotate(180deg);
}

.nav-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 200px;
    background: white;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    list-style: none;
    padding: var(--spacing-xs) 0;
    margin-top: var(--spacing-xs);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all var(--transition-base);
    z-index: 1000;
}

/* Only show direct child dropdown on hover, not nested ones */
.nav-item-dropdown:hover > .nav-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.nav-dropdown li {
    margin: 0;
}

.nav-dropdown a {
    display: block;
    padding: var(--spacing-sm) var(--spacing-md);
    color: var(--text-secondary);
    white-space: nowrap;
    transition: all var(--transition-fast);
    border-radius: 0;
}

.nav-dropdown a:hover {
    background-color: var(--bg-secondary);
    color: var(--primary-color);
    transform: translateX(4px);
}

.nav-dropdown a.active {
    background-color: rgba(14, 165, 233, 0.08);
    color: var(--primary-color);
}

/* Dropdown headers and dividers */
.dropdown-header {
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background-color: var(--bg-secondary);
    cursor: default;
}

.dropdown-divider {
    height: 1px;
    background-color: #e5e7eb;
    margin: 0.25rem 0;
}

/* Nested Dropdown Menus */
.nav-dropdown .nav-item-dropdown {
    position: relative;
}

.nav-dropdown .nav-item-dropdown > a {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-dropdown .nav-item-dropdown > a::after {
    content: '›';
    font-size: 1rem;
    margin-left: 0.5rem;
    transition: transform var(--transition-fast);
}

/* Hide nested dropdowns by default */
.nav-dropdown .nav-dropdown {
    position: absolute;
    left: 100%;
    top: 0;
    margin-top: 0;
    margin-left: 0;
    opacity: 0;
    visibility: hidden;
    transform: translateX(-10px);
    transition: all var(--transition-fast);
    z-index: 1001;
}

/* Show nested dropdown on hover of parent item */
.nav-dropdown .nav-item-dropdown:hover > .nav-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

/* ==========================================================================
   Hero Section
   ========================================================================== */

.hero {
    background:
        radial-gradient(at 27% 37%, hsla(215, 98%, 61%, 1) 0px, transparent 50%),
        radial-gradient(at 97% 21%, hsla(125, 98%, 72%, 1) 0px, transparent 50%),
        radial-gradient(at 52% 99%, hsla(354, 98%, 61%, 1) 0px, transparent 50%),
        radial-gradient(at 10% 29%, hsla(256, 96%, 67%, 1) 0px, transparent 50%),
        radial-gradient(at 97% 96%, hsla(38, 60%, 74%, 1) 0px, transparent 50%),
        radial-gradient(at 33% 50%, hsla(222, 67%, 73%, 1) 0px, transparent 50%),
        radial-gradient(at 79% 53%, hsla(343, 68%, 79%, 1) 0px, transparent 50%),
        linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    padding: var(--spacing-2xl) 0;
    text-align: center;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
}

.hero-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: var(--spacing-md);
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 1.25rem;
    margin-bottom: var(--spacing-xl);
    opacity: 0.95;
}

.hero-cta {
    display: flex;
    gap: var(--spacing-md);
    justify-content: center;
    flex-wrap: wrap;
}

/* ==========================================================================
   Tools Section
   ========================================================================== */

.tools-section {
    padding: var(--spacing-2xl) 0;
    background-color: var(--bg-secondary);
}

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

/* ==========================================================================
   CTA Section
   ========================================================================== */

.cta-section {
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--secondary-dark) 100%);
    color: white;
    padding: var(--spacing-2xl) 0;
    text-align: center;
}

.cta-content h2 {
    font-size: 2rem;
    margin-bottom: var(--spacing-sm);
}

.cta-content p {
    font-size: 1.125rem;
    margin-bottom: var(--spacing-lg);
    opacity: 0.95;
}

.cta-note {
    font-size: 0.875rem;
    margin-top: var(--spacing-md);
    opacity: 0.8;
}

/* ==========================================================================
   Contact Section
   ========================================================================== */

.contact-section {
    padding: var(--spacing-2xl) 0;
}

.contact-form {
    max-width: 600px;
    margin: 0 auto;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-md);
}

/* ==========================================================================
   Footer
   ========================================================================== */

.footer {
    background-color: var(--bg-dark);
    color: var(--text-light);
    padding: var(--spacing-xl) 0 var(--spacing-md);
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-xl);
    margin-bottom: var(--spacing-lg);
}

.footer-section h3,
.footer-section h4 {
    color: white;
    margin-bottom: var(--spacing-sm);
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: var(--spacing-xs);
}

.footer-section a {
    color: var(--text-light);
}

.footer-section a:hover {
    color: white;
}

.footer-bottom {
    text-align: center;
    padding-top: var(--spacing-md);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-light);
    font-size: 0.875rem;
}

/* ==========================================================================
   Responsive Design - Mobile First
   ========================================================================== */

@media (max-width: 768px) {
    .nav-toggle {
        display: flex;
        min-width: 44px;
        min-height: 44px;
        justify-content: center;
        align-items: center;
    }

    .tagline {
        font-size: 1rem;
    }

    .nav-menu {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        flex-direction: column;
        align-items: stretch;
        padding: 0.5rem;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
        border-top: 1px solid rgba(229, 231, 235, 0.6);
        display: none;
        animation: slideDown 0.3s ease-out;
    }

    @keyframes slideDown {
        from {
            opacity: 0;
            transform: translateY(-10px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    .nav-menu.active {
        display: flex;
    }

    .nav-menu a {
        padding: 0.75rem 1rem;
        text-align: left;
        min-height: 44px;
        display: flex;
        align-items: center;
    }

    /* Mobile Dropdown Styles */
    .nav-item-dropdown {
        display: flex;
        flex-direction: column;
    }

    .nav-item-dropdown > a {
        text-align: left;
    }

    .nav-dropdown {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        background: var(--bg-secondary);
        border-radius: 0;
        margin: 0;
        padding: 0;
        max-height: 0;
        overflow: hidden;
        transition: max-height var(--transition-base);
        display: block;
    }

    .nav-item-dropdown.active .nav-dropdown {
        max-height: 500px;
    }

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

    .nav-dropdown a {
        padding: 0.5rem 1rem;
        transform: none !important;
    }

    .nav-dropdown a:hover {
        transform: none !important;
    }

    /* Mobile Nested Dropdowns */
    .nav-dropdown li {
        margin: 0 !important;
        padding: 0 !important;
    }

    .nav-dropdown .nav-item-dropdown {
        margin: 0 !important;
        padding: 0 !important;
    }

    .nav-dropdown .nav-item-dropdown > a {
        padding: 0.35rem 1rem;
        padding-left: 1rem;
        font-weight: 600;
        margin: 0;
        min-height: auto;
        height: auto;
        line-height: 1.2;
    }

    .nav-dropdown .nav-dropdown {
        position: static;
        margin: 0;
        padding: 0;
        background: transparent;
        display: none;
        border-radius: 0;
    }

    .nav-dropdown .nav-dropdown li {
        margin: 0;
        padding: 0;
    }

    .nav-dropdown .nav-dropdown a {
        padding: 0.5rem 1rem;
        padding-left: 1.5rem;
    }

    .nav-item-dropdown .nav-item-dropdown.active .nav-dropdown {
        display: block;
    }

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

    .hero-subtitle {
        font-size: 1rem;
    }

    .hero-cta {
        flex-direction: column;
    }

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

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

@media (min-width: 1024px) {
    .hero-title {
        font-size: 3rem;
    }
}
