/* ==========================================================================
   CSS Variables - Soothing Red & Purple Theme
   ========================================================================== */
:root {
    /* Color Palette */
    --clr-primary: #7D5A80;       /* Muted Amethyst Purple - main brand color */
    --clr-primary-light: #9B789F; /* Soft Purple - hovers and accents */
    --clr-primary-dark: #543956;  /* Deep Plum - footer and deep accents */
    
    --clr-accent: #D56B73;        /* Soothing Rose Red - buttons and highlights */
    --clr-accent-dark: #B24C53;   /* Darker Rose - button hovers */
    
    /* Backgrounds & Text */
    --clr-bg-light: #F7F2F4;      /* Very pale purplish-pink - alt section backgrounds */
    --clr-bg-white: #ffffff;      /* Pure white */
    --clr-text-main: #3A2E3B;     /* Dark plum-grey - main body text */
    --clr-text-muted: #6D5C6E;    /* Muted plum-grey - secondary text */
    --clr-heading: #543956;       /* Deep Plum - headings */

    /* Typography */
    --font-main: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    
    /* Layout */
    --container-max-width: 1200px;
    --border-radius: 8px;
    --transition-speed: 0.3s;
    --box-shadow: 0 4px 6px rgba(84, 57, 86, 0.08);
    --box-shadow-hover: 0 10px 15px rgba(84, 57, 86, 0.15);
}


/* ==========================================================================
   Base Styles & Reset
   ========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

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

h1, h2, h3, h4, h5, h6 {
    color: var(--clr-heading);
    margin-bottom: 1rem;
    font-weight: 600;
}

p {
    margin-bottom: 1rem;
}

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

a:hover {
    color: var(--clr-accent);
}

ul {
    list-style: none;
}

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

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

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: var(--border-radius);
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    border: none;
    transition: all var(--transition-speed) ease;
}

.btn-primary {
    background-color: var(--clr-accent);
    color: var(--clr-bg-white);
}

.btn-primary:hover {
    background-color: var(--clr-accent-dark);
    color: var(--clr-bg-white);
    transform: translateY(-2px);
    box-shadow: var(--box-shadow);
}

/* ==========================================================================
   Header & Navigation
   ========================================================================== */
.site-header {
    background-color: var(--clr-bg-white);
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.top-bar-wrapper {
    border-bottom: 1px solid var(--clr-bg-light);
    padding: 15px 0;
}

.top-bar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-image {
    height: 50px;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 20px;
}

.header-quick-contacts {
    display: flex;
    gap: 20px;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    font-weight: 500;
}

.contact-item i {
    color: var(--clr-primary);
    font-size: 1.1rem;
}

.contact-item:hover i {
    color: var(--clr-accent);
}

.main-nav {
    background-color: var(--clr-primary-dark);
}

#nav-menu {
    display: flex;
    justify-content: center;
}

.nav-link {
    display: block;
    padding: 15px 20px;
    color: var(--clr-bg-white);
    font-weight: 500;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
}

.nav-link:hover {
    background-color: var(--clr-primary);
    color: var(--clr-bg-white);
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--clr-primary);
    cursor: pointer;
}

/* ==========================================================================
   Hero Section Layout
   ========================================================================== */
/* Note: The background image and padding are handled inline in your index.php */
.hero-content-container {
    text-align: center;
}

.hero-section h1 {
    font-size: 3rem;
    color: var(--clr-primary-dark);
    margin-bottom: 20px;
}

.hero-section p {
    font-size: 1.25rem;
    color: var(--clr-text-main);
    margin-bottom: 30px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* ==========================================================================
   General Sections
   ========================================================================== */
.content-section {
    padding: 80px 0;
}

.content-section.alt-bg {
    background-color: var(--clr-bg-light);
}

.content-section h2 {
    text-align: center;
    font-size: 2.25rem;
    margin-bottom: 40px;
    position: relative;
    padding-bottom: 15px;
}

.content-section h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background-color: var(--clr-accent);
}

/* ==========================================================================
   Grids (Doctors, Services, Contacts)
   ========================================================================== */
.doctors-grid,
.service-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

/* Cards */
.doctor-card,
.service-card {
    background: var(--clr-bg-white);
    padding: 30px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    text-align: center;
    transition: transform var(--transition-speed), box-shadow var(--transition-speed);
    border-bottom: 4px solid transparent;
}

.doctor-card:hover,
.service-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--box-shadow-hover);
    border-bottom-color: var(--clr-primary-light);
}

.doctor-img {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 20px;
    border: 3px solid var(--clr-bg-light);
}

.service-icon-img {
    width: 64px;
    height: 64px;
    margin: 0 auto 20px;
}

.doctor-card h3,
.service-card h3 {
    color: var(--clr-primary-dark);
    margin-bottom: 10px;
}

.qualification {
    color: var(--clr-accent);
    font-weight: 600;
    margin-bottom: 15px;
}

/* ==========================================================================
   Appointment Form
   ========================================================================== */
#appointmentForm {
    max-width: 800px;
    margin: 0 auto;
    background: var(--clr-bg-white);
    padding: 40px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    border-top: 5px solid var(--clr-primary);
}

.form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.form-group {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--clr-text-main);
}

.form-group input,
.form-group select {
    padding: 12px 15px;
    border: 1px solid #ccc;
    border-radius: var(--border-radius);
    font-family: inherit;
    font-size: 1rem;
    transition: border-color var(--transition-speed);
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--clr-primary-light);
    box-shadow: 0 0 0 3px rgba(155, 120, 159, 0.2);
}

.form-submit-btn {
    width: 100%;
    font-size: 1.1rem;
    padding: 15px;
    margin-top: 10px;
}

/* ==========================================================================
   Contact & Location
   ========================================================================== */
.contact-info-box {
    background: var(--clr-bg-white);
    padding: 40px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    text-align: center;
}

.contact-icon {
    color: var(--clr-accent);
    margin-right: 8px;
}

.location-details-grid {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 30px;
    background: var(--clr-bg-white);
    padding: 30px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.map-container iframe {
    width: 100%;
    height: 100%;
    min-height: 300px;
    border-radius: var(--border-radius);
}

/* ==========================================================================
   Gallery
   ========================================================================== */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
}

.gallery-item {
    border-radius: var(--border-radius);
    overflow: hidden;
}

.gallery-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: transform var(--transition-speed);
}

.gallery-item:hover img {
    transform: scale(1.05);
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
    background-color: var(--clr-primary-dark);
    color: var(--clr-bg-light);
    padding: 40px 0;
    text-align: center;
}

.site-footer p {
    margin-bottom: 10px;
}

.footer-admin-link {
    color: var(--clr-primary-light);
    font-size: 0.9rem;
}

.footer-admin-link:hover {
    color: var(--clr-bg-white);
}

/* ==========================================================================
   Responsive Design (Media Queries)
   ========================================================================== */
@media (max-width: 992px) {
    .header-quick-contacts {
        display: none; 
    }
    
    .menu-toggle {
        display: block;
    }

    .main-nav {
        display: none; 
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        flex-direction: column;
    }
    
    .main-nav.active {
        display: block;
    }

    #nav-menu {
        flex-direction: column;
    }

    .nav-link {
        text-align: center;
        border-bottom: 1px solid var(--clr-primary);
    }

    .location-details-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    
    .form-group {
        margin-bottom: 20px;
    }
    
    .hero-section h1 {
        font-size: 2.2rem;
    }
}

/* ==========================================================================
   Self-Assessment Tools Section (Integrated with Theme Variables)
   ========================================================================== */
.purple-theme-section {
    /* Uses your brand's deep and primary purples for the gradient */
    background: linear-gradient(135deg, var(--clr-primary-dark) 0%, var(--clr-primary) 100%);
    color: var(--clr-bg-white);
    text-align: center;
    /* content-section padding is inherited, keeping this clean */
}

.purple-theme-section h2.purple-section-title {
    color: var(--clr-bg-white);
    margin-bottom: 15px;
}

/* Overrides the default red heading underline to pop against the purple background */
.purple-theme-section h2.purple-section-title::after {
    background-color: var(--clr-bg-light); 
}

.purple-theme-section p.purple-section-desc {
    color: var(--clr-bg-light);
    margin-bottom: 40px;
    font-size: 1.1rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin-top: 20px;
}

.tool-card {
    background-color: var(--clr-bg-white);
    border-radius: var(--border-radius);
    padding: 40px 20px;
    color: var(--clr-text-main);
    box-shadow: var(--box-shadow);
    transition: transform var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    border-bottom: 4px solid transparent;
}

.tool-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--box-shadow-hover);
    border-bottom-color: var(--clr-accent); /* Ties in the soothing rose red on hover */
}

.tool-icon {
    font-size: 50px;
    margin-bottom: 20px;
}

.tool-card h3 {
    color: var(--clr-heading);
    margin-bottom: 15px;
    font-size: 1.4rem;
}

.tool-card p {
    color: var(--clr-text-muted);
    margin-bottom: 30px;
    font-size: 1rem;
    line-height: 1.6;
    flex-grow: 1;
}

.btn-tool {
    display: inline-block;
    background-color: var(--clr-primary);
    color: var(--clr-bg-white);
    padding: 12px 24px;
    border-radius: var(--border-radius);
    text-decoration: none;
    font-weight: 600;
    transition: all var(--transition-speed) ease;
    width: 80%;
    border: none;
}

.btn-tool:hover {
    background-color: var(--clr-primary-dark);
    color: var(--clr-bg-white);
    transform: translateY(-2px);
    box-shadow: var(--box-shadow);
}

/* --- Force Footer to Bottom on Short Pages --- */
body {
    display: flex;
    flex-direction: column;
    min-height: 100vh; /* 100% of the browser window height */
}

main {
    flex: 1; /* Forces the main content area to stretch and fill empty space */
}
