/* ============================================
   CLEAN STYLES.CSS 
   ============================================ */

/* === DARK MODE CSS VARIABLES === */
:root {
    /* Light Mode (Default) */
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-card: #ffffff;
    --text-primary: #1a1a1a;
    --text-secondary: #666666;
    --text-light: #999999;
    --border-color: #e0e0e0;
    --shadow: rgba(0, 0, 0, 0.1);
    --shadow-hover: rgba(0, 0, 0, 0.15);
    --primary-color: #0066cc;
    --primary-light: #e8f2ff;
    --accent-color: #ffd700;
    --success-color: #28a745;
    --error-color: #dc3545;
    --hero-gradient-start: #0066cc;
    --hero-gradient-end: #004d99;
}

[data-theme="dark"] {
    /* Dark Mode */
    --bg-primary: #1a1a1a;
    --bg-secondary: #2d2d2d;
    --bg-card: #242424;
    --text-primary: #e0e0e0;
    --text-secondary: #b0b0b0;
    --text-light: #888888;
    --border-color: #404040;
    --shadow: rgba(0, 0, 0, 0.3);
    --shadow-hover: rgba(0, 0, 0, 0.5);
    --primary-color: #3399ff;
    --primary-light: #1a2d44;
    --accent-color: #ffd700;
    --success-color: #4caf50;
    --error-color: #f44336;
    --hero-gradient-start: #0066cc;
    --hero-gradient-end: #004d99;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* === TYPOGRAPHY === */
h1, h2, h3, h4, h5, h6 {
    color: var(--text-primary);
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 1rem;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }

p, li, span, label {
    color: var(--text-secondary);
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    opacity: 0.8;
}

/* === HEADER === */
.header {
    background-color: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 2px 10px var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
    transition: all 0.3s ease;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    max-width: 1400px;
    margin: 0 auto;
    position: relative;
}

.logo h1 {
    color: var(--primary-color);
    font-size: 1.5rem;
    margin: 0;
}

.tagline {
    color: var(--text-light);
    font-size: 0.85rem;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
}

.nav-menu a {
    color: var(--text-primary);
    font-weight: 500;
    transition: color 0.2s;
}

.nav-menu a:hover,
.nav-menu a.active {
    color: var(--primary-color);
}

/* === TOOLS DROPDOWN === */
.nav-dropdown {
    position: relative;
}

.nav-dropdown-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: inherit;
    font-weight: 500;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0;
    transition: color 0.2s;
    line-height: inherit;
}

.nav-dropdown-btn:hover,
.nav-dropdown-btn.active {
    color: var(--primary-color);
}

.dropdown-arrow {
    font-size: 0.72rem;
    transition: transform 0.2s ease;
    display: inline-block;
    line-height: 1;
}

.nav-dropdown.open .dropdown-arrow {
    transform: rotate(180deg);
}

/* HIDDEN by default — display:none is the reliable fallback */
.nav-dropdown .dropdown-menu {
    display: none !important;
    position: absolute;
    top: calc(100% + 0.6rem);
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    list-style: none !important;
    padding: 0.4rem 0;
    min-width: 190px;
    z-index: 9999;
    margin: 0;
}

/* OPEN state — JS adds .open to .nav-dropdown */
.nav-dropdown.open .dropdown-menu {
    display: block !important;
    animation: dropdownFadeIn 0.15s ease forwards;
}

/* Desktop hover — show dropdown on mouse over */
@media (min-width: 769px) {
    .nav-dropdown:hover .dropdown-menu {
        display: block !important;
        animation: dropdownFadeIn 0.15s ease forwards;
    }
    .nav-dropdown:hover .dropdown-arrow {
        transform: rotate(180deg);
    }
}

@keyframes dropdownFadeIn {
    from { opacity: 0; transform: translateX(-50%) translateY(-6px); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.dropdown-menu li {
    list-style: none !important;
    padding: 0 !important;
    border: none !important;
    margin: 0 !important;
}

.dropdown-menu li::before,
.dropdown-menu li::marker {
    display: none !important;
    content: none !important;
}

.dropdown-menu a {
    display: block;
    padding: 0.65rem 1.2rem;
    color: var(--text-primary);
    font-size: 0.93rem;
    font-weight: 500;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s;
    text-decoration: none;
}

.dropdown-menu a:hover {
    background: var(--bg-secondary);
    color: var(--primary-color);
    opacity: 1;
}

/* === HAMBURGER MENU === */
.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 101;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background-color: var(--text-primary);
    transition: all 0.3s ease;
    border-radius: 3px;
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(7px, 7px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* === CLINIC PAGE — WHITE TEXT ON COLOURED BACKGROUNDS ===
   The global p/span/li rule (color: var(--text-secondary)) bleeds through
   into any section with a blue/gradient background. These rules fix that
   without touching individual clinic page HTML files. */

/* Hero gradient — matches homepage and directory */
.clinic-detail-hero {
    background: linear-gradient(135deg, #0055aa 0%, #0077ee 60%, #0099ff 100%) !important;
}

/* Hero section on all clinic detail pages */
.clinic-detail-hero p,
.clinic-detail-hero span,
.clinic-detail-hero li,
.clinic-detail-hero label {
    color: #fff !important;
}

/* Final CTA section — override inline gradient to match site style */
.detail-section[style*="linear-gradient"] {
    background: linear-gradient(135deg, #0055aa 0%, #0077ee 60%, #0099ff 100%) !important;
}

/* Final CTA section — uses inline gradient style on .detail-section */
.detail-section[style*="linear-gradient"] p,
.detail-section[style*="linear-gradient"] span,
.detail-section[style*="linear-gradient"] li,
.detail-section[style*="linear-gradient"] h2,
.detail-section[style*="linear-gradient"] h3 {
    color: #fff !important;
}

/* === HERO SECTION === */
.hero {
    background: linear-gradient(135deg, #0055aa 0%, #0077ee 60%, #0099ff 100%);
    color: var(--text-primary);
    padding: 4rem 2rem;
    text-align: center;
}

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

.hero-title {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--bg-card);
}

.hero-subtitle {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    color: var(--bg-card);
    opacity: 0.9;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin: 2rem 0;
    flex-wrap: wrap;
}

.stat {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent-color);
}

.stat-label {
    font-size: 0.9rem;
    color: var(--bg-card);
    opacity: 0.8;
}

.hero-cta {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
    flex-wrap: wrap;
}

/* === BUTTONS === */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    text-align: center;
}

.btn-primary {
    background: var(--primary-color);
    color: var(--bg-card);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow-hover);
}

.btn-secondary {
    background: transparent;
    border: 2px solid var(--bg-card);
    color: var(--bg-card);
}

.btn-secondary:hover {
    background: var(--bg-card);
    color: var(--primary-color);
}

.btn-reset {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-reset:hover {
    background: var(--border-color);
}

.btn-contact {
    background: var(--primary-color);
    color: var(--bg-card);
    width: 100%;
    padding: 0.75rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-contact:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow-hover);
}

.btn-submit {
    background: var(--primary-color);
    color: var(--bg-card);
    padding: 1rem 2rem;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow-hover);
}

/* === SECTIONS === */
.filter-section,
.pricing-section,
.contact-section {
    background-color: var(--bg-secondary);
    padding: 3rem 2rem;
}

.clinics-section {
    background-color: var(--bg-primary);
    padding: 4rem 2rem;
}

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

.section-subtitle {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 3rem;
}

/* === MAP on the homepage === */
/* === MAP CTA SECTION === */
.map-cta {
    padding: 3rem 1.5rem;
    margin: 3rem 0;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: var(--bg-card);
    text-align: center;
}

.map-cta h2 {
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    font-size: 1.75rem;
}

.map-cta p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

.map-cta .btn {
    margin-top: 0;
}

/* === MATCHER CTA SECTION === */
.matcher-cta {
    padding: 4rem 1.5rem;
    margin: 5rem 0 3rem;
    background: linear-gradient(135deg, rgba(0, 102, 204, 0.05) 0%, rgba(0, 77, 153, 0.05) 100%);
    border: 2px solid var(--primary-color);
    border-radius: 16px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

[data-theme="dark"] .matcher-cta {
    background: linear-gradient(135deg, rgba(51, 153, 255, 0.1) 0%, rgba(0, 102, 204, 0.1) 100%);
}

.matcher-cta::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(0, 102, 204, 0.08) 0%, transparent 70%);
    pointer-events: none;
}

.matcher-content {
    max-width: 700px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.matcher-cta h2 {
    color: var(--text-primary);
    margin-bottom: 1rem;
    font-size: 2rem;
}

.matcher-subtitle {
    color: var(--text-secondary);
    margin-bottom: 2rem;
    font-size: 1.1rem;
    line-height: 1.6;
}

.matcher-features {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin: 2rem 0;
    flex-wrap: wrap;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.feature-icon {
    font-size: 1.3rem;
}

.btn-matcher {
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
    margin-top: 1rem;
    box-shadow: 0 4px 15px rgba(0, 102, 204, 0.2);
}

.btn-matcher:hover {
    box-shadow: 0 6px 20px rgba(0, 102, 204, 0.3);
}

/* === FILTERS === */
.filters {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.filter-select {
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: var(--bg-card);
    color: var(--text-primary);
    font-size: 1rem;
    cursor: pointer;
    min-width: 200px;
}

.filter-select:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* === CLINIC CARDS === */
.clinics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.clinic-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 15px var(--shadow);
    transition: all 0.3s ease;
    position: relative;
}

.clinic-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px var(--shadow-hover);
}

.clinic-card.hidden {
    display: none;
}

.clinic-card.featured {
    border: 2px solid var(--primary-color);
}

.clinic-rank {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.rank-number {
    background: var(--primary-color);
    color: var(--bg-card);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
}

.featured-badge {
    background: var(--success-color);
    color: var(--bg-card);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.clinic-header h3 {
    color: var(--text-primary);
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
}

.rating {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.stars {
    color: var(--accent-color);
    font-size: 1.2rem;
}

.rating-number {
    font-weight: 600;
    color: var(--text-primary);
}

.review-count {
    color: var(--text-light);
    font-size: 0.9rem;
}

.clinic-website {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.clinic-website a {
    color: var(--primary-color);
}

.pros-cons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin: 1rem 0;
}

.pros h4 {
    color: var(--success-color);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.cons h4 {
    color: var(--error-color);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.pros ul, .cons ul {
    list-style: none;
    padding: 0;
}

.pros li, .cons li {
    font-size: 0.85rem;
    margin-bottom: 0.25rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.clinic-specialties {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 1rem 0;
}

.specialty-tag {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.8rem;
    border: 1px solid var(--border-color);
}

/* === PRICING SECTION === */
.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.pricing-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 2px 10px var(--shadow);
}

.pricing-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.pricing-card h3 {
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.pricing-card p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.price-examples {
    margin-top: 1rem;
}

.price-item {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
}

.price {
    font-weight: 600;
    color: var(--primary-color);
}

/* === FORMS === */
.contact-form {
    background-color: var(--bg-card);
    padding: 2rem;
    border-radius: 12px;
    max-width: 800px;
    margin: 0 auto;
    box-shadow: 0 2px 10px var(--shadow);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    font-weight: 500;
}

input[type="text"],
input[type="email"],
input[type="tel"],
select,
textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: var(--bg-card);
    color: var(--text-primary);
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

textarea {
    resize: vertical;
    min-height: 100px;
}

/* === FOOTER === */
.footer {
    background-color: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 3rem 2rem 2rem;
    color: var(--text-secondary);
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.footer-section h3,
.footer-section h4 {
    color: var(--text-primary);
    margin-bottom: 1rem;
}

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

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

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

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

.footer-bottom {
    text-align: center;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

/* === DARK MODE TOGGLE === */
.theme-toggle {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 1000;
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: 50%;
    width: 60px;
    height: 60px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 4px 12px var(--shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.theme-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px var(--shadow-hover);
}

.theme-toggle:active {
    transform: scale(0.95);
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
    }

    .nav-container {
        padding: 1rem;
        position: relative;
    }

    .hamburger {
        display: flex;
    }

    .nav-menu {
        position: absolute;
        top: 100%;
        right: 0;
        width: 280px;
        background-color: var(--bg-card);
        border: 1px solid var(--border-color);
        border-radius: 8px;
        box-shadow: 0 8px 24px var(--shadow);
        flex-direction: column;
        align-items: flex-start;
        padding: 1rem 0;
        opacity: 0;
        visibility: hidden;
        transform: translateY(-10px);
        transition: all 0.3s ease;
        z-index: 100;
        gap: 0;
    }

    .nav-menu.active {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

    .nav-menu li {
        width: 100%;
        border-bottom: 1px solid var(--border-color);
    }

    .nav-menu li:last-child {
        border-bottom: none;
    }

    .nav-menu a {
        display: block;
        width: 100%;
        padding: 0.75rem 1.25rem;
        font-size: 1rem;
        color: var(--text-primary);
        text-decoration: none;
        transition: background-color 0.2s;
    }

    .nav-menu a:hover {
        background-color: var(--bg-secondary);
    }

    /* Mobile: dropdown becomes inline accordion */
    .nav-dropdown {
        width: 100%;
        border-bottom: 1px solid var(--border-color);
        padding: 1rem 0;
    }

    .nav-dropdown-btn {
        width: 100%;
        font-size: 1.1rem;
        padding: 0;
        justify-content: space-between;
    }

    .nav-dropdown .dropdown-menu {
        /* Override desktop absolute positioning */
        position: static !important;
        transform: none !important;
        left: auto !important;
        box-shadow: none !important;
        border: none !important;
        border-radius: 0 !important;
        background: var(--bg-secondary) !important;
        padding: 0.25rem 0 0 !important;
        min-width: auto !important;
        z-index: auto !important;
        animation: none !important;
        display: none !important;
    }

    .nav-dropdown.open .dropdown-menu {
        display: block !important;
        animation: none !important;
    }

    .dropdown-menu a {
        padding: 0.65rem 1.25rem;
        font-size: 1rem;
        border-bottom: 1px solid var(--border-color);
    }

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

    .hero-stats {
        gap: 1.5rem;
    }

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

    .form-row {
        grid-template-columns: 1fr;
    }

    .pros-cons {
        grid-template-columns: 1fr;
    }

    .theme-toggle {
        bottom: 1.5rem;
        right: 1.5rem;
        width: 50px;
        height: 50px;
        font-size: 1.3rem;
    }

    .matcher-cta {
        padding: 3rem 1rem;
        margin: 4rem 0 2rem;
    }

    .matcher-cta h2 {
        font-size: 1.5rem;
    }

    .matcher-features {
        flex-direction: column;
        gap: 1rem;
        align-items: center;
    }

    .footer-content {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .hero {
        padding: 2rem 1rem;
    }

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

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

/* === UTILITY CLASSES === */
.hidden {
    display: none !important;
}

.no-results-message {
    text-align: center;
    padding: 3rem;
    color: var(--text-light);
    grid-column: 1 / -1;
}