:root {
    --primary: #0066FF;
    --primary-dark: #0052CC;
    --accent: #00C853;
    --dark: #1E1E1E;
    --light: #F8F9FA;
    --white: #FFFFFF;
    --gray: #6C757D;
    --border: #E9ECEF;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    --glass: rgba(255, 255, 255, 0.8);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--light);
    color: var(--dark);
    line-height: 1.6;
    overflow-x: hidden;
    width: 100%;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header & Nav */
header {
    background: var(--white);
    box-shadow: var(--shadow);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 10000;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.logo-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    gap: 10px;
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
}

nav ul {
    display: flex;
    list-style: none;
    gap: 30px;
}

nav a {
    text-decoration: none;
    color: var(--dark);
    font-weight: 500;
    transition: var(--transition);
}

nav a:hover {
    color: var(--primary);
}

/* Mobile Menu */
.menu-toggle {
    display: none;
    cursor: pointer;
}

@media (max-width: 768px) {
    nav {
        display: none;
    }

    .menu-toggle {
        display: block;
    }
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--primary) 0%, #0044BB 100%);
    color: var(--white);
    padding: 80px 0;
    text-align: center;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 20px;
}

.hero p {
    font-size: 1.2rem;
    opacity: 0.9;
    max-width: 700px;
    margin: 0 auto 40px;
}

/* Tool Section */
.tool-card {
    background: var(--white);
    border-radius: 20px;
    padding: 40px;
    box-shadow: var(--shadow);
    margin-top: -60px;
    position: relative;
    z-index: 10;
}

.search-box {
    position: relative;
    margin-bottom: 30px;
}

.search-box input {
    width: 100%;
    padding: 15px 25px;
    border: 1px solid var(--border);
    border-radius: 50px;
    font-size: 1.1rem;
    outline: none;
    transition: var(--transition);
}

.search-box input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 10px rgba(0, 102, 255, 0.1);
}

/* Timezone Grid */
.timezone-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.clock-card {
    background: var(--light);
    border-radius: 15px;
    padding: 25px;
    position: relative;
    transition: var(--transition);
    border: 1px solid transparent;
}

.clock-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
    background: var(--white);
}

.clock-card.detected-zone {
    border: 3px solid var(--accent);
    background: #f1fff7;
    box-shadow: 0 0 15px rgba(0, 200, 83, 0.2);
}

.clock-card .badge {
    position: absolute;
    top: -12px;
    left: 20px;
    background: var(--accent);
    color: white;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 800;
    z-index: 10;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.clock-card .time {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary);
    font-family: 'Space Grotesk', sans-serif;
}

.clock-card .date {
    font-size: 0.9rem;
    color: var(--gray);
    margin-bottom: 10px;
}

.clock-card .zone-name {
    font-weight: 600;
    font-size: 1.1rem;
}

/* AdSense Placeholders */
.adsense-placeholder {
    display: none;
    background: #f0f0f0;
    text-align: center;
    padding: 20px;
    border: 1px dashed #ccc;
    margin: 20px 0;
    font-size: 0.8rem;
    color: #999;
}

/* Footer */
footer {
    background: var(--dark);
    color: var(--white);
    padding: 60px 0 20px;
    margin-top: 80px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-col h4 {
    margin-bottom: 20px;
    color: var(--primary);
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 10px;
}

.footer-links a {
    color: #ccc;
    text-decoration: none;
    transition: var(--transition);
}

.footer-links a:hover {
    color: var(--white);
}

.copyright {
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 20px;
    font-size: 0.9rem;
    opacity: 0.6;
}

/* --- MOBILE PERFECTION OVERHAUL (Truly Robust) --- */

/* Navigation Mobile */
@media (max-width: 768px) {
    header {
        padding: 10px 0;
        position: relative;
        /* Prevent sticky issues during menu open */
    }

    .logo-text {
        font-size: 1.2rem;
    }

    nav {
        display: none !important;
        /* Force hide unless active */
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: var(--white);
        box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
        padding: 30px 20px;
        z-index: 9999;
        border-top: 1px solid var(--border);
    }

    nav.active {
        display: block !important;
    }

    nav ul {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }

    nav a {
        font-size: 1.2rem;
        display: block;
        padding: 10px;
    }

    .menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        padding: 5px;
    }

    /* Hero & Tool spacing */
    .hero {
        padding: 40px 0 100px;
    }

    .hero h1 {
        font-size: 1.8rem !important;
        margin-bottom: 15px;
    }

    .hero p {
        font-size: 1rem;
        opacity: 0.8;
    }

    .tool-card {
        padding: 25px 15px;
        margin-top: -60px;
        border-radius: 15px;
        width: calc(100% - 30px);
        margin-left: auto;
        margin-right: auto;
    }

    /* THE GRID FIX: Force Single Column */
    .timezone-grid {
        grid-template-columns: 1fr !important;
        gap: 15px !important;
        width: 100%;
    }

    .clock-card {
        padding: 20px;
        text-align: center;
    }

    .clock-card .time {
        font-size: 2.2rem !important;
    }

    .clock-card .badge {
        font-size: 0.65rem;
        top: -12px;
        left: 50%;
        transform: translateX(-50%);
        white-space: nowrap;
    }

    .remove-btn {
        top: 5px;
        right: 5px;
        scale: 0.8;
    }

    /* Planner Fixes */
    section.meeting-planner {
        margin-top: 50px !important;
    }

    .planner-card {
        padding: 20px 15px !important;
    }

    #plannerResults {
        grid-template-columns: 1fr !important;
    }

    /* Content Area */
    .seo-guide {
        margin-top: 50px !important;
        padding: 0 15px;
    }
}

@media (max-width: 480px) {
    .large-time {
        font-size: 1.8rem !important;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }
}