/* Modern Style for AI Toolbird */
:root {
    --primary: #0274be;
    --primary-hover: #025790;
    --dark: #091e4f;
    --light: #f8f6f3;
    --white: #ffffff;
    --gray: #666;
    --border: #eaeaea;
    --shadow: 0 4px 20px rgba(0,0,0,0.08);
    --radius: 12px;
    --font-main: 'Open Sans', system-ui, -apple-system, sans-serif;
    --font-heading: 'Merriweather', serif;
}

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

body {
    font-family: var(--font-main);
    line-height: 1.6;
    color: var(--dark);
    background-color: var(--white);
    overflow-x: hidden;
}

/* Hide skip links and hidden text */
.screen-reader-text, .ast-skip-link, .skip-link {
    display: none !important;
}

/* CRITICAL: Fix SVG scaling issue causing 30,000px height */
svg {
    max-width: 100% !important;
    max-height: 500px !important; /* Cap height to prevent explosion */
}

.e-font-icon-svg, .elementor-element svg {
    width: auto !important;
    height: 1em !important; /* Icons should be small */
    max-width: 100px !important;
}

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

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

/* Header & Navigation */
#masthead {
    background: var(--white);
    border-bottom: 1px solid var(--border);
    padding: 10px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.ast-container {
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 20px;
}

.ast-builder-grid-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: nowrap;
}

/* Nav Menu */
.main-header-menu {
    list-style: none;
    display: flex;
    gap: 20px;
    align-items: center;
}

.main-header-menu li {
    position: relative;
    display: inline-block;
}

.main-header-menu li a {
    font-weight: 500;
    font-size: 14px;
    color: var(--dark);
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 5px;
}

.main-header-menu li a:hover {
    color: var(--primary);
}

/* Submenu */
.sub-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--white);
    border: 1px solid var(--border);
    padding: 10px 0;
    box-shadow: var(--shadow);
    z-index: 1100;
    min-width: 220px;
    border-radius: 4px;
    list-style: none;
}

.main-header-menu li:hover > .sub-menu {
    display: block;
}

.sub-menu li {
    display: block;
    width: 100%;
}

.sub-menu li a {
    padding: 10px 20px;
    font-size: 13px;
    color: var(--dark);
    display: block;
}

.sub-menu li a:hover {
    background-color: var(--light);
    color: var(--primary);
}

.ast-icon.icon-arrow svg {
    width: 10px !important;
    height: 10px !important;
    fill: currentColor;
}

/* Hide Mobile Elements on Desktop */
.ast-mobile-menu-trigger-fill, 
.ast-menu-toggle, 
.ast-mobile-header-wrap,
#ast-mobile-popup-wrapper,
.menu-toggle {
    display: none !important;
}

/* Hero Section */
.elementor-element-c4f854c {
    background: linear-gradient(135deg, #f0f7ff 0%, #ffffff 100%);
    padding: 80px 0 !important;
    text-align: center;
    min-height: auto !important;
}

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

.elementor-heading-title {
    font-family: var(--font-heading);
    margin-bottom: 20px;
    color: var(--dark);
    display: block;
    width: 100%;
}

.elementor-element-2df9ddf .elementor-heading-title {
    font-size: 2.8rem !important;
    line-height: 1.2;
    text-align: center;
}

/* Category Buttons */
.elementor-element-14ca4f6 .e-con-inner {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 30px;
    flex-wrap: wrap;
}

.elementor-button {
    display: inline-block;
    padding: 12px 24px;
    background-color: var(--primary);
    color: var(--white) !important;
    border-radius: 50px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 13px;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.elementor-button:hover {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(2, 116, 190, 0.2);
}

/* Fixing Excessive Whitespace */
.elementor-section, .e-con, .e-con-inner, .elementor-container {
    min-height: auto !important;
    padding: 20px 0 !important;
    margin: 0 auto !important;
    position: relative !important;
}

/* Tool Grid / Favorites */
.elementor-element-7439a27 {
    padding: 40px 0 !important;
}

.elementor-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
    margin-top: 20px !important;
}

.elementor-post {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    min-height: auto !important;
}

/* Footer Section */
.site-footer {
    background-color: var(--dark);
    color: var(--white);
    padding: 60px 0 30px;
}

.footer-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
}

/* Responsive Fixes */
@media (max-width: 921px) {
    .ast-builder-grid-row {
        flex-direction: column;
        text-align: center;
    }
    
    .main-header-menu {
        flex-direction: column;
        gap: 10px;
        padding-top: 10px;
    }

    .elementor-element-2df9ddf .elementor-heading-title {
        font-size: 2rem !important;
    }
}
