/* ==========================================================================
   Main Stylesheet - DiabetPerio Redesign
   ========================================================================== */

/* --- CSS Reset & Base Styles --- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

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

body {
    font-family: var(--font-sans);
    background-color: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    font-weight: var(--font-weight-bold);
    color: var(--color-brand-blue);
    line-height: 1.2;
}

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

a:hover {
    color: var(--color-brand-blue-hover);
}

ul {
    list-style: none;
}

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

/* --- Utility Classes --- */
.container {
    width: 100%;
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 var(--container-padding);
}

.text-center {
    text-align: center;
}

.text-muted {
    color: var(--text-secondary);
}

.text-sm {
    font-size: var(--text-sm);
}

.mt-3 {
    margin-top: var(--space-3);
}

.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    /* for mobile */
    gap: var(--space-4);
}

.section-padding {
    padding: var(--space-16) 0;
}

.bg-light {
    background-color: var(--bg-surface);
}

.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-lg);
    border-radius: var(--border-radius-xl);
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    font-family: var(--font-heading);
    font-weight: var(--font-weight-semibold);
    font-size: var(--text-base);
    border-radius: var(--border-radius-pill);
    border: none;
    cursor: pointer;
    transition: all var(--transition-bounce);
    outline: none;
    text-decoration: none;
}

.btn-primary {
    background-color: var(--color-primary-600);
    color: white;
    box-shadow: 0 4px 14px rgba(13, 148, 136, 0.4);
}

.btn-primary:hover {
    background-color: var(--color-primary-500);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(13, 148, 136, 0.6);
    color: white;
}

.btn-secondary {
    background-color: var(--color-brand-blue);
    color: white;
    box-shadow: 0 4px 14px rgba(30, 58, 138, 0.3);
}

.btn-secondary:hover {
    background-color: var(--color-brand-blue-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(30, 58, 138, 0.5);
    color: white;
}

.btn-outline {
    background-color: transparent;
    border: 2px solid var(--color-brand-blue);
    color: var(--color-brand-blue);
}

.btn-outline:hover {
    background-color: var(--color-brand-blue);
    color: white;
}

/* --- Header & Navigation --- */
.main-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    transition: all var(--transition-normal);
    /* Initial state (transparent) */
    background: transparent;
    padding: var(--space-4) 0;
}

.main-header.scrolled {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    box-shadow: var(--shadow-sm);
    padding: var(--space-2) 0;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.logo-text {
    font-family: var(--font-heading);
    font-size: var(--text-2xl);
    font-weight: var(--font-weight-bold);
    color: var(--color-brand-blue);
}

.logo-accent {
    color: var(--color-primary-600);
}

.nav-list {
    display: flex;
    gap: var(--space-6);
}

.nav-link {
    font-family: var(--font-heading);
    font-weight: var(--font-weight-medium);
    color: var(--text-secondary);
    position: relative;
    padding: var(--space-1) 0;
}

.nav-link:hover,
.nav-link.active {
    color: var(--color-brand-blue);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0%;
    height: 2px;
    background-color: var(--color-primary-500);
    transition: width var(--transition-normal);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: var(--text-2xl);
    color: var(--color-brand-blue);
    cursor: pointer;
}

/* --- Hero Section --- */
.hero-section {
    position: relative;
    min-height: 90vh;
    display: flex;
    align-items: center;
    padding-top: var(--space-24);
    overflow: hidden;
    background: linear-gradient(135deg, var(--color-gray-50) 0%, #e0f2fe 100%);
}

.hero-bg-shapes .shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    z-index: 0;
    opacity: 0.6;
}

.hero-bg-shapes .shape-1 {
    width: 500px;
    height: 500px;
    background: var(--color-primary-100);
    top: -100px;
    right: -100px;
}

.hero-bg-shapes .shape-2 {
    width: 400px;
    height: 400px;
    background: #bfdbfe;
    bottom: -50px;
    left: -100px;
}

.hero-container {
    position: relative;
    z-index: 1;
}

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

.hero-badge {
    display: inline-block;
    padding: 0.25rem 1rem;
    background-color: rgba(13, 148, 136, 0.1);
    color: var(--color-primary-700);
    border-radius: var(--border-radius-pill);
    font-weight: var(--font-weight-bold);
    font-size: var(--text-sm);
    margin-bottom: var(--space-4);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.hero-title {
    font-size: clamp(2.5rem, 5vw, 4rem);
    margin-bottom: var(--space-4);
}

.hero-subtitle {
    font-size: var(--text-xl);
    color: var(--text-secondary);
    margin-bottom: var(--space-8);
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.hero-cta-group {
    display: flex;
    gap: var(--space-4);
    flex-wrap: wrap;
    /* For mobile */
}

/* --- Sections Common --- */
.section-header {
    margin-bottom: var(--space-12);
}

.section-title {
    font-size: var(--text-3xl);
    margin-bottom: var(--space-2);
}

.section-desc {
    color: var(--text-secondary);
    font-size: var(--text-lg);
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.flex-between .section-desc {
    margin-left: 0;
}

/* --- Pillars Section --- */
.pillars-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--space-6);
    /* For centered 5th item */
    justify-content: center;
}

.pillar-card {
    background-color: var(--bg-surface);
    padding: var(--space-8);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-bounce);
    border: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.pillar-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-hover);
    border-color: var(--color-primary-100);
}

.pillar-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background-color: rgba(13, 148, 136, 0.1);
    color: var(--color-primary-600);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: var(--space-4);
    transition: all var(--transition-fast);
}

.pillar-card:hover .pillar-icon {
    background-color: var(--color-primary-600);
    color: white;
}

.pillar-title {
    font-size: var(--text-xl);
    margin-bottom: var(--space-2);
}

.pillar-desc {
    color: var(--text-secondary);
}

/* --- Approach Section (Timeline) --- */
.approach-steps {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    max-width: 900px;
    margin: 0 auto;
    position: relative;
}

.step-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 1;
}

.step-number {
    width: 80px;
    height: 80px;
    background-color: var(--color-brand-blue);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-heading);
    font-size: var(--text-2xl);
    font-weight: var(--font-weight-bold);
    margin-bottom: var(--space-4);
    box-shadow: 0 0 0 10px rgba(30, 58, 138, 0.1);
}

.step-title {
    font-size: var(--text-lg);
    margin-bottom: var(--space-2);
}

.step-desc {
    color: var(--text-secondary);
    font-size: var(--text-sm);
}

.step-connector {
    flex: 1;
    height: 2px;
    background-color: var(--border-light);
    margin-top: 40px;
    /* Align with center of circle (80/2) */
    position: relative;
    z-index: 0;
}

/* --- News Section --- */
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: var(--space-6);
}

.news-card {
    background: var(--bg-surface);
    border-radius: var(--border-radius-lg);
    padding: var(--space-6);
    border: 1px solid var(--border-light);
    transition: var(--transition-normal);
}

.news-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--color-primary-500);
}

.news-date {
    font-size: var(--text-sm);
    color: var(--color-primary-600);
    font-weight: var(--font-weight-semibold);
    margin-bottom: var(--space-2);
}

.news-title {
    font-size: var(--text-xl);
    margin-bottom: var(--space-2);
}

.news-excerpt {
    color: var(--text-secondary);
    margin-bottom: var(--space-4);
}

.read-more {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    font-weight: var(--font-weight-semibold);
    color: var(--color-brand-accent);
}

.read-more i {
    transition: transform var(--transition-fast);
}

.read-more:hover i {
    transform: translateX(4px);
}

/* --- CTA Section --- */
.cta-section {
    padding-bottom: var(--space-16);
}

.cta-card {
    padding: var(--space-12) var(--space-4);
    background: linear-gradient(135deg, rgba(20, 184, 166, 0.05) 0%, rgba(30, 58, 138, 0.05) 100%);
}

.cta-title {
    font-size: var(--text-3xl);
    margin-bottom: var(--space-2);
}

.cta-desc {
    color: var(--text-secondary);
    margin-bottom: var(--space-6);
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.newsletter-form {
    display: flex;
    max-width: 500px;
    margin: 0 auto;
    gap: var(--space-2);
}

.newsletter-form input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-light);
    border-radius: var(--border-radius-pill);
    font-family: var(--font-sans);
    font-size: var(--text-base);
    outline: none;
    transition: border-color var(--transition-fast);
}

.newsletter-form input:focus {
    border-color: var(--color-primary-500);
    box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.2);
}

/* --- Footer --- */
.main-footer {
    background-color: var(--color-gray-900);
    color: var(--text-inverse);
    padding-top: var(--space-16);
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: var(--space-8);
    margin-bottom: var(--space-12);
}

.footer-brand .logo-text,
.footer-brand .logo-accent {
    color: white;
}

.footer-about {
    color: var(--color-gray-300);
    margin: var(--space-4) 0;
    max-width: 300px;
}

.social-links {
    display: flex;
    gap: var(--space-3);
}

.social-links a {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: all var(--transition-fast);
}

.social-links a:hover {
    background-color: var(--color-primary-500);
    transform: translateY(-2px);
}

.footer-heading {
    color: white;
    font-size: var(--text-lg);
    margin-bottom: var(--space-4);
}

.footer-links ul li {
    margin-bottom: var(--space-2);
}

.footer-links a,
.contact-list li {
    color: var(--color-gray-300);
    transition: color var(--transition-fast);
}

.footer-links a:hover {
    color: white;
    padding-left: 4px;
}

.contact-list li {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-bottom: var(--space-3);
}

.contact-list i {
    color: var(--color-primary-500);
}

.footer-bottom {
    background-color: rgba(0, 0, 0, 0.2);
    padding: var(--space-4) 0;
}

.footer-bottom .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--color-gray-500);
    font-size: var(--text-sm);
}

.footer-legal {
    display: flex;
    gap: var(--space-4);
}

.footer-legal a {
    color: var(--color-gray-500);
}

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

/* --- Media Queries (Mobile First approach naturally baked into responsive design) --- */

@media (max-width: 900px) {
    .approach-steps {
        flex-direction: column;
        align-items: center;
        gap: var(--space-8);
    }

    .step-connector {
        display: none;
    }

    .step-item {
        max-width: 100%;
        text-align: center;
    }
}

@media (max-width: 768px) {
    .mobile-menu-btn {
        display: block;
    }

    .main-nav {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: var(--bg-surface);
        padding: var(--space-4);
        box-shadow: var(--shadow-md);
        transform: translateY(-10px);
        opacity: 0;
        visibility: hidden;
        transition: all var(--transition-normal);
        border-top: 1px solid var(--border-light);
    }

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

    .nav-list {
        flex-direction: column;
        gap: var(--space-2);
        text-align: center;
    }

    .nav-link {
        display: block;
        padding: var(--space-2);
    }

    .nav-link::after {
        display: none;
    }

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

    .footer-grid {
        grid-template-columns: 1fr;
        gap: var(--space-8);
    }

    .footer-bottom .container {
        flex-direction: column;
        gap: var(--space-4);
        text-align: center;
    }

    .newsletter-form {
        flex-direction: column;
    }
}

/* --- JS Controlled Animations --- */
.animate-fade-in {
    opacity: 1 !important;
    transform: translateY(0) !important;
}
/* --- Homepage Updates Carousels --- */
.updates-slider-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-6);
    margin-top: var(--space-8);
}

@media (max-width: 992px) {
    .updates-slider-container {
        grid-template-columns: 1fr;
    }
}

.update-slot {
    position: relative;
    height: 550px;
    border-radius: var(--border-radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    background: var(--color-gray-100);
}

.update-carousel {
    height: 100%;
    width: 100%;
    position: relative;
    overflow: hidden;
}

.update-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.8s ease-in-out, transform 0.8s ease-out;
    background-size: cover;
    background-position: center;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: var(--space-8);
    color: white;
    text-decoration: none;
    transform: scale(1.05);
}

.update-slide.active {
    opacity: 1;
    z-index: 1;
    transform: scale(1);
}

.update-slide::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0.1) 0%, rgba(0,0,0,0.8) 100%);
    z-index: 1;
}

.update-content {
    position: relative;
    z-index: 2;
    text-align: center;
}

.update-title {
    font-size: 2.2rem;
    font-family: var(--font-heading);
    margin-bottom: var(--space-4);
    line-height: 1.1;
    font-weight: 700;
}

.update-date {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    font-weight: 600;
    padding-top: var(--space-4);
    border-top: 1px solid rgba(255,255,255,0.4);
    display: inline-block;
    width: 100%;
}

.update-dots {
    position: absolute;
    bottom: var(--space-6);
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0.5rem;
    z-index: 3;
}

.update-dot {
    width: 8px;
    height: 8px;
    background: rgba(255,255,255,0.4);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
}

.update-dot.active {
    background: var(--color-primary-400);
    width: 24px;
    border-radius: 4px;
}
