/* ========================================
   ROOT & VARIABLES
   ======================================== */
:root {
    --primary: #0f4c81;
    --primary-light: #1a6bb5;
    --primary-dark: #0a3660;
    --accent: #10b981;
    --accent-light: #34d399;
    --accent-dark: #059669;
    --warm: #f59e0b;
    --warm-light: #fbbf24;
    --danger: #ef4444;
    --bg: #f8fafc;
    --surface: #ffffff;
    --text: #1e293b;
    --text-light: #64748b;
    --text-lighter: #94a3b8;
    --border: #e2e8f0;
    --footer-bg: #0f172a;
    --navbar-height: 76px;
    --transition: 0.3s ease;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.06);
    --shadow-lg: 0 12px 40px rgba(0,0,0,0.1);
    --shadow-xl: 0 20px 60px rgba(0,0,0,0.12);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
}

/* ========================================
   BASE
   ======================================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--bg);
    color: var(--text);
    padding-top: var(--navbar-height);
    line-height: 1.7;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

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

::selection { background: var(--accent); color: white; }

/* ========================================
   NAVBAR
   ======================================== */
.navbar {
    background: var(--primary);
    padding: 0;
    height: var(--navbar-height);
    transition: all var(--transition);
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.navbar.scrolled {
    background: rgba(15, 76, 129, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 4px 24px rgba(0,0,0,0.15);
}

.navbar-brand {
    color: white !important;
    padding: 8px 0;
    transition: opacity var(--transition);
}

.navbar-brand:hover { opacity: 0.9; }

.brand-text div:first-child {
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: -0.01em;
}

.brand-text div:last-child {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.7);
    font-weight: 400;
}

.navbar-toggler {
    border: 1px solid rgba(255,255,255,0.3);
    padding: 6px 10px;
}

.navbar-toggler:focus {
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.4);
    outline: none;
}

.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(255,255,255,0.9)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

.navbar-nav .nav-link {
    color: rgba(255,255,255,0.85) !important;
    font-weight: 500;
    font-size: 0.9rem;
    margin: 0 2px;
    padding: 8px 16px;
    border-radius: 8px;
    transition: all var(--transition);
    position: relative;
}

.navbar-nav .nav-link:hover {
    color: white !important;
    background: rgba(255,255,255,0.1);
}

.navbar-nav .nav-link.active {
    color: white !important;
    background: var(--accent);
}

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

.navbar-nav .nav-link i { font-size: 0.85em; }

/* ========================================
   PAGE HEADER
   ======================================== */
.page-header {
    background: var(--primary);
    color: white;
    padding: 72px 0 56px;
    margin-bottom: 48px;
    position: relative;
    overflow: hidden;
}

.page-header::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: radial-gradient(circle at 20% 80%, rgba(16,185,129,0.15) 0%, transparent 50%),
                radial-gradient(circle at 80% 20%, rgba(245,158,11,0.1) 0%, transparent 50%);
}

.page-header::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 40px;
    background: var(--bg);
    clip-path: ellipse(55% 100% at 50% 100%);
}

.page-header h1 {
    position: relative;
    z-index: 1;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.page-header p {
    position: relative;
    z-index: 1;
}

/* ========================================
   HERO SECTION
   ======================================== */
.hero-section {
    background: var(--primary);
    color: white;
    padding: 80px 0 72px;
    position: relative;
    overflow: hidden;
    min-height: 480px;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: radial-gradient(circle at 10% 90%, rgba(16,185,129,0.2) 0%, transparent 40%),
                radial-gradient(circle at 90% 10%, rgba(245,158,11,0.1) 0%, transparent 40%);
}

.hero-section::after {
    content: '';
    position: absolute;
    bottom: -1px; left: 0; right: 0;
    height: 48px;
    background: var(--bg);
    clip-path: ellipse(55% 100% at 50% 100%);
}

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

.hero-section h1 {
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.15;
}

.hero-section .lead {
    color: rgba(255,255,255,0.85);
    font-weight: 400;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(16,185,129,0.2);
    border: 1px solid rgba(16,185,129,0.3);
    color: var(--accent-light);
    padding: 6px 16px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 20px;
}

/* Carousel */
#asmCarousel {
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
}

#asmCarousel .carousel-inner {
    height: 380px;
    position: relative;
}

#asmCarousel .carousel-item {
    height: 380px;
    display: none;
    transition: transform 0.6s ease-in-out;
}

#asmCarousel .carousel-item.active,
#asmCarousel .carousel-item-next,
#asmCarousel .carousel-item-prev {
    display: flex !important;
    align-items: center;
    justify-content: center;
}

#asmCarousel .carousel-item-start,
#asmCarousel .carousel-item-end {
    position: absolute !important;
    top: 0;
}

#asmCarousel .carousel-item img {
    max-height: 100%;
    max-width: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: var(--radius-sm);
}

.carousel-indicators { margin-bottom: 12px; z-index: 2; }

.carousel-indicators [data-bs-target] {
    width: 10px; height: 10px;
    border-radius: 50%;
    background: rgba(255,255,255,0.3);
    margin: 0 4px;
    border: none;
    transition: all var(--transition);
}

.carousel-indicators .active { background: var(--accent); width: 28px; border-radius: 5px; }

.carousel-control-prev,
.carousel-control-next {
    width: 10%;
    opacity: 0;
    transition: opacity var(--transition);
    z-index: 2;
}

#asmCarousel:hover .carousel-control-prev,
#asmCarousel:hover .carousel-control-next { opacity: 1; }

.carousel-control-prev-icon,
.carousel-control-next-icon {
    background-color: rgba(255,255,255,0.15);
    backdrop-filter: blur(8px);
    border-radius: 50%;
    width: 42px; height: 42px;
    background-size: 20px;
    transition: background-color var(--transition);
}

.carousel-control-prev-icon:hover,
.carousel-control-next-icon:hover {
    background-color: var(--accent);
}

/* ========================================
   CARDS
   ======================================== */
.feature-card,
.service-card,
.doctor-card,
.contact-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 32px;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition);
    height: 100%;
    border: 1px solid var(--border);
    position: relative;
}

.feature-card:hover,
.service-card:hover,
.doctor-card:hover,
.contact-card:hover {
    box-shadow: var(--shadow-lg);
    border-color: transparent;
    transform: translateY(-4px);
}

.feature-icon,
.service-icon,
.contact-icon {
    width: 56px; height: 56px;
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    font-size: 1.4rem;
    color: white;
    flex-shrink: 0;
}

.feature-card.text-center .feature-icon { margin: 0 auto 20px; }

/* ========================================
   SECTION TITLES
   ======================================== */
.section-title {
    color: var(--text);
    font-weight: 800;
    margin-bottom: 8px;
    letter-spacing: -0.02em;
    font-size: 2rem;
}

.section-subtitle {
    color: var(--text-light);
    font-size: 1.05rem;
    max-width: 560px;
    margin: 0 auto;
}

/* ========================================
   DOCTORS
   ======================================== */
.doctor-card {
    overflow: visible;
    text-align: center;
}

.doctor-avatar {
    width: 72px; height: 72px;
    border-radius: 50%;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    letter-spacing: 1px;
}

.doctor-name {
    color: var(--text);
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 4px;
}

.doctor-title {
    color: var(--accent-dark);
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 16px;
}

.doctor-details {
    list-style: none;
    padding: 0;
    margin: 0;
    text-align: left;
}

.doctor-details li {
    padding: 8px 0;
    font-size: 0.88rem;
    color: var(--text-light);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 10px;
}

.doctor-details li:last-child { border-bottom: none; }

.doctor-details li i {
    color: var(--accent);
    width: 18px;
    text-align: center;
    font-size: 0.85rem;
}

/* Old class (not used anymore but kept for compat) */
.doctor-image { display: none; }

/* ========================================
   SERVICE LIST
   ======================================== */
.service-card {
    border-left: 4px solid var(--accent);
}

.service-title {
    color: var(--text);
    font-weight: 700;
    font-size: 1.15rem;
    margin-bottom: 16px;
}

.service-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.service-list li {
    padding: 8px 0 8px 28px;
    position: relative;
    color: var(--text-light);
    font-size: 0.92rem;
    line-height: 1.5;
}

.service-list li::before {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    left: 0;
    color: var(--accent);
    font-size: 0.8rem;
}

/* ========================================
   ALERT & INFO
   ======================================== */
.custom-alert,
.info-box {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    border-radius: var(--radius-lg);
    padding: 28px 32px;
    margin-bottom: 32px;
    border: none;
}

.custom-alert h4,
.info-box h4 {
    color: white;
    margin-bottom: 8px;
    font-weight: 600;
}

.custom-alert p,
.info-box p {
    color: rgba(255,255,255,0.9);
    margin: 0;
}

.info-box .btn-light {
    background: white;
    color: var(--primary);
    border: none;
    font-weight: 600;
    border-radius: var(--radius-sm);
}

.info-box .btn-light:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

/* ========================================
   GALLERY
   ======================================== */
.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    margin-bottom: 24px;
    cursor: pointer;
    height: 260px;
    border: 1px solid var(--border);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

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

.gallery-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(transparent 40%, rgba(15,76,129,0.85));
    display: flex;
    align-items: flex-end;
    padding: 20px;
    opacity: 0;
    transition: opacity var(--transition);
}

.gallery-item:hover .gallery-overlay { opacity: 1; }

.gallery-caption {
    color: white;
    transform: translateY(10px);
    transition: transform var(--transition);
}

.gallery-item:hover .gallery-caption { transform: translateY(0); }

.gallery-caption p {
    font-weight: 500;
    margin: 0;
    font-size: 0.95rem;
}

/* ========================================
   CONTACT FORM
   ======================================== */
.contact-form {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 36px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
}

.form-control,
.form-select {
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    padding: 11px 14px;
    font-size: 0.92rem;
    transition: all var(--transition);
    background: var(--bg);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
    background: white;
}

.form-label {
    font-weight: 500;
    color: var(--text);
    margin-bottom: 6px;
    font-size: 0.9rem;
}

.btn-submit {
    background: var(--accent);
    color: white;
    padding: 12px 36px;
    border-radius: var(--radius-sm);
    border: none;
    font-weight: 600;
    transition: all var(--transition);
    cursor: pointer;
}

.btn-submit:hover {
    background: var(--accent-dark);
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.25);
    transform: translateY(-1px);
}

/* ========================================
   MAP
   ======================================== */
.map-container {
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    height: 400px;
    border: 1px solid var(--border);
}

.map-container iframe { border: none; }

/* ========================================
   CTA SECTION
   ======================================== */
.cta-section {
    background: var(--primary);
    color: white;
    padding: 80px 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.cta-section::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: radial-gradient(circle at 30% 50%, rgba(16,185,129,0.15) 0%, transparent 50%);
}

.cta-section h2,
.cta-section p,
.cta-section .btn-custom { position: relative; z-index: 1; }

.btn-custom {
    background: var(--accent);
    color: white;
    padding: 14px 36px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
    transition: all var(--transition);
}

.btn-custom:hover {
    background: var(--accent-dark);
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.3);
    transform: translateY(-2px);
    color: white;
}

/* ========================================
   INFO SECTION
   ======================================== */
.info-section {
    padding: 80px 0;
    background: white;
}

/* ========================================
   FOOTER
   ======================================== */
footer {
    background: var(--footer-bg);
    color: rgba(255,255,255,0.8);
    padding: 56px 0 0;
    margin-top: 0;
}

footer h5 {
    color: white;
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 20px;
    letter-spacing: -0.01em;
}

footer p, footer a {
    color: rgba(255,255,255,0.6);
    font-size: 0.88rem;
    line-height: 1.8;
}

footer a {
    text-decoration: none;
    transition: color var(--transition);
}

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

footer ul { padding-left: 0; list-style: none; }
footer ul li { margin-bottom: 6px; }

.footer-links .link-row {
    display: flex;
    align-items: flex-start;
    margin-bottom: 8px;
}

.footer-links .link-row > span {
    color: var(--accent);
    margin-right: 8px;
    font-weight: 600;
    flex-shrink: 0;
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.08);
    padding: 20px 0;
    margin-top: 40px;
}

.footer-bottom p {
    color: rgba(255,255,255,0.4);
    font-size: 0.82rem;
}

/* ========================================
   BUTTONS (Bootstrap overrides)
   ======================================== */
.btn-primary {
    background: var(--accent);
    border: none;
    padding: 11px 28px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    transition: all var(--transition);
}

.btn-primary:hover,
.btn-primary:active,
.btn-primary:focus {
    background: var(--accent-dark);
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.25);
    transform: translateY(-1px);
}

.btn-outline-primary {
    border-color: var(--accent);
    color: var(--accent);
    border-radius: var(--radius-sm);
    padding: 9px 22px;
    font-weight: 500;
    transition: all var(--transition);
}

.btn-outline-primary:hover {
    background: var(--accent);
    border-color: var(--accent);
    transform: translateY(-1px);
}

.btn-outline-light {
    border: 2px solid rgba(255,255,255,0.5);
    color: white;
    border-radius: var(--radius-sm);
    padding: 11px 28px;
    font-weight: 600;
}

.btn-outline-light:hover {
    background: white;
    color: var(--primary);
    border-color: white;
}

/* ========================================
   MODALS
   ======================================== */
.modal-content {
    border-radius: var(--radius-lg);
    border: none;
    overflow: hidden;
}

.modal-header {
    border-bottom: none;
    background: var(--primary);
    color: white;
    padding: 16px 24px;
}

.modal-body { padding: 24px; }

.modal-body img.img-fluid {
    border-radius: var(--radius-md);
    max-width: 100%;
    height: auto;
}

.modal-xl .modal-body { padding: 0; }

.modal-footer {
    border-top: 1px solid var(--border);
    padding: 12px 24px;
}

/* ========================================
   BADGES & UTILITIES
   ======================================== */
.badge {
    padding: 6px 14px;
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.82rem;
}

.card {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.table-hover tbody tr:hover {
    background-color: rgba(16, 185, 129, 0.04);
}

.bg-primary { background-color: var(--primary) !important; }
.text-primary { color: var(--primary) !important; }

/* Wave divider helper */
.wave-divider {
    position: relative;
}

.wave-divider::after {
    content: '';
    position: absolute;
    bottom: -1px; left: 0; right: 0;
    height: 48px;
    background: var(--bg);
    clip-path: ellipse(55% 100% at 50% 100%);
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 1200px) {
    .container { max-width: 100%; padding-left: 20px; padding-right: 20px; }
}

@media (max-width: 992px) {
    :root { --navbar-height: 68px; }

    #asmCarousel .carousel-inner { height: 320px; }
    #asmCarousel .carousel-item { height: 320px; }

    .hero-section { padding: 64px 0 56px; }

    .navbar-collapse {
        background: var(--primary-dark);
        margin-top: 12px;
        padding: 12px;
        border-radius: var(--radius-md);
        border: 1px solid rgba(255,255,255,0.1);
    }

    .navbar-nav .nav-link {
        padding: 10px 14px;
        margin: 2px 0;
        border-radius: var(--radius-sm);
    }

    .navbar-nav .nav-link:hover,
    .navbar-nav .nav-link.active {
        background: rgba(16, 185, 129, 0.2);
    }

    .navbar-nav .nav-link.active {
        background: var(--accent);
    }
}

@media (max-width: 768px) {
    .hero-section { padding: 48px 0 40px; }
    .page-header { padding: 56px 0 40px; margin-bottom: 32px; }

    #asmCarousel .carousel-inner { height: 280px; }
    #asmCarousel .carousel-item { height: 280px; }

    .gallery-item { height: 220px; }
    .map-container { height: 300px; }
    .contact-form { padding: 24px 20px; }

    .feature-card, .service-card,
    .doctor-card, .contact-card {
        padding: 24px;
    }

    .feature-icon, .service-icon, .contact-icon {
        width: 48px; height: 48px;
        font-size: 1.2rem;
    }

    .cta-section { padding: 56px 0; }
    .info-section { padding: 56px 0; }

    footer { padding: 40px 0 0; }

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

@media (max-width: 576px) {
    html { font-size: 15px; }
    .hero-section { padding: 36px 0 28px; min-height: auto; }
    .page-header { padding: 44px 0 28px; }

    #asmCarousel .carousel-inner { height: 240px; }
    #asmCarousel .carousel-item { height: 240px; }

    .gallery-item { height: 200px; }
    .map-container { height: 250px; }

    .btn-submit, .btn-custom {
        width: 100%;
        padding: 12px 20px;
        text-align: center;
    }

    .brand-text div:first-child { font-size: 0.95rem; }
    .brand-text div:last-child { font-size: 0.75rem; }

    .feature-card, .service-card,
    .doctor-card, .contact-card { padding: 20px; }

    .display-4 { font-size: 1.8rem; }
    .lead { font-size: 0.95rem; }

    .modal-dialog { margin: 8px; }
    .modal-xl { max-width: 100%; }

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

/* ========================================
   ACCESSIBILITY
   ======================================== */
.btn:focus, .form-control:focus, .form-select:focus {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ========================================
   PRINT
   ======================================== */
@media print {
    .navbar, footer, .btn, .modal { display: none !important; }
    body { padding-top: 0; }
    .page-header { page-break-after: avoid; }
}
