/* ==========================================================================
   Puskesmas Jatinegara - Design System & Theme
   Target: CodeIgniter 3 + Bootstrap 5
   ========================================================================== */

:root {
    /* Brand Palette */
    --primary: #00A693;
    /* Medical Tosca */
    --primary-dark: #008C7B;
    --secondary: #4A90E2;
    /* Trust Blue */
    --secondary-dark: #357ABD;
    --accent: #FFB300;
    /* Warm Yellow */

    /* Neutrals */
    --dark: #2D3748;
    --text-body: #4A5568;
    --light: #F7FAFC;
    --white: #FFFFFF;
    --border: #E2E8F0;

    /* System */
    --font-heading: 'Poppins', sans-serif;
    --font-body: 'Inter', sans-serif;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --radius: 12px;
    --radius-sm: 8px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);

    /* Bootstrap Overrides */
    --bs-primary: #00A693;
    --bs-secondary: #4A90E2;
    --bs-body-font-family: 'Inter', sans-serif;
}

/* ==========================================================================
   Typography & Base
   ========================================================================== */
body {
    font-family: var(--font-body);
    color: var(--text-body);
    background-color: var(--light);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    color: var(--dark);
    font-weight: 600;
    line-height: 1.25;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-dark);
}

/* ==========================================================================
   Components
   ========================================================================== */
/* Buttons */
.btn {
    border-radius: var(--radius-sm);
    font-weight: 500;
    padding: 10px 24px;
    transition: var(--transition);
}

.btn-primary {
    background-color: var(--primary);
    border-color: var(--primary);
    color: var(--white);
    box-shadow: 0 2px 4px rgba(0, 166, 147, 0.3);
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0, 166, 147, 0.4);
}

.btn-outline-primary {
    color: var(--primary);
    border-color: var(--primary);
}

.btn-outline-primary:hover {
    background-color: var(--primary);
    color: var(--white);
}

/* Cards */
.card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    overflow: hidden;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: transparent;
}

.card-title {
    font-weight: 600;
    margin-bottom: 0.75rem;
}

/* Forms */
.form-control,
.form-select {
    border-radius: var(--radius-sm);
    border-color: var(--border);
    padding: 12px 16px;
    font-size: 1rem;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 166, 147, 0.15);
}

/* ==========================================================================
   Layout Areas
   ========================================================================== */
/* Top Bar */
.top-bar {
    background-color: var(--dark);
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.875rem;
    padding: 8px 0;
}

.top-bar i {
    color: var(--primary);
    margin-right: 6px;
}

/* Navbar */
.navbar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    padding: 1rem 0;
}

.navbar-brand .brand-name {
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--dark);
    font-size: 1.25rem;
}

.navbar-brand .brand-slogan {
    color: var(--primary);
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    font-weight: 500;
}

.nav-link {
    font-family: var(--font-body);
    font-weight: 500;
    color: var(--text-body);
    padding: 8px 12px !important;
    font-size: 0.9rem;
    white-space: nowrap;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary);
}

/* Navbar responsive adjustments */
@media (min-width: 992px) and (max-width: 1200px) {
    .nav-link {
        padding: 8px 8px !important;
        font-size: 0.85rem;
    }

    .navbar-brand .brand-name {
        font-size: 1.1rem;
    }
}

/* Hero Section - Responsive (Full Image, No Crop) */
.hero-slider {
    position: relative;
    overflow: hidden;
    background-color: var(--dark);
}

.hero-slider .carousel-item {
    position: relative;
    background-color: var(--dark);
}

.hero-slider .carousel-item img {
    width: 100%;
    height: auto;
    display: block;
    /* No cropping - show full image */
}

/* Optional: Untuk slider dengan teks overlay */
.hero-slider .carousel-caption {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    bottom: auto;
    right: auto;
    text-align: center;
    width: 90%;
    max-width: 800px;
    padding: 2rem;
    background: rgba(0, 0, 0, 0.4);
    border-radius: var(--radius);
}

.hero-slider h2 {
    font-size: clamp(1.5rem, 5vw, 3rem);
    font-weight: 700;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    margin-bottom: 1rem;
    font-family: var(--font-heading);
    line-height: 1.2;
}

.hero-slider p {
    font-size: clamp(0.9rem, 2vw, 1.25rem);
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
    margin-bottom: 1.5rem;
}

.hero-slider .btn {
    padding: 12px 28px;
    font-size: 1rem;
}

@media (max-width: 576px) {
    .hero-slider .carousel-caption {
        padding: 1rem;
        width: 95%;
    }

    .hero-slider .btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
}

/* Feature/Service Cards */
.service-card {
    background: var(--white);
    padding: 2.5rem 2rem;
    text-align: center;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    transition: var(--transition);
}

.service-card .icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, rgba(0, 166, 147, 0.1), rgba(74, 144, 226, 0.1));
    color: var(--primary);
    border-radius: 50%;
    font-size: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    transition: var(--transition);
}

.service-card:hover .icon {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: var(--white);
    transform: scale(1.1);
}

/* News Cards */
.news-card .card-img-top {
    height: 220px;
    object-fit: cover;
}

.news-card .news-meta {
    font-size: 0.8rem;
    color: var(--secondary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Footer */
.footer {
    background-color: #1A202C;
    /* Darker than var(--dark) */
    color: #CBD5E0;
    padding-top: 4rem;
}

.footer h5 {
    color: var(--white);
    margin-bottom: 1.5rem;
    font-weight: 600;
}

.footer-social a {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: var(--white);
    margin-right: 10px;
    transition: var(--transition);
}

.footer-social a:hover {
    background: var(--primary);
    transform: translateY(-2px);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: #171923;
    padding: 1.5rem 0;
    font-size: 0.875rem;
    margin-top: 3rem;
}

/* Page Header */
.page-header {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    padding: 4rem 0;
    color: var(--white);
    margin-bottom: 3rem;
    position: relative;
    overflow: hidden;
}

.page-header::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-43-7c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm63 31c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM34 90c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm56-76c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM12 86c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm28-65c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm23-11c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-6 60c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm29 22c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zM32 63c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm57-13c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-9-21c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM60 91c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM35 41c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM12 60c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2z' fill='%23ffffff' fill-opacity='0.1' fill-rule='evenodd'/%3E%3C/svg%3E");
}

.page-header h1 {
    color: var(--white);
    font-weight: 700;
}

.page-header .breadcrumb-item,
.page-header .breadcrumb-item a {
    color: rgba(255, 255, 255, 0.8);
}

.page-header .breadcrumb-item.active {
    color: var(--white);
}

/* Utilities */
.text-primary {
    color: var(--primary) !important;
}

.bg-primary {
    background-color: var(--primary) !important;
}

.text-justify {
    text-align: justify;
}

.section-title {
    position: relative;
    display: inline-block;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: var(--accent);
    border-radius: 2px;
}

/* ==========================================================================
   Utilities & Extras
   ========================================================================== */

/* Tables */
.table {
    border-radius: var(--radius-sm);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.table thead {
    background-color: var(--primary);
    color: var(--white);
}

.table th {
    font-weight: 600;
    border: none;
    padding: 1rem;
}

.table td {
    padding: 1rem;
    vertical-align: middle;
}

/* Pagination */
.pagination {
    justify-content: center;
    margin-top: 2rem;
}

.page-item .page-link {
    border: none;
    margin: 0 4px;
    border-radius: var(--radius-sm) !important;
    color: var(--text-body);
    font-weight: 500;
    padding: 0.5rem 1rem;
}

.page-item.active .page-link {
    background-color: var(--primary);
    color: var(--white);
    box-shadow: 0 2px 4px rgba(0, 166, 147, 0.3);
}

.page-item .page-link:hover:not(.active) {
    background-color: var(--bs-gray-200);
    color: var(--primary);
}

/* Alerts */
.alert {
    border: none;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
}

.alert-info {
    background-color: rgba(74, 144, 226, 0.1);
    color: var(--secondary);
}

.alert-success {
    background-color: rgba(0, 166, 147, 0.1);
    color: var(--primary-dark);
}

/* Back to Top */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 45px;
    height: 45px;
    background: var(--primary);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 1000;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background: var(--primary-dark);
    color: var(--white);
    transform: translateY(-3px);
}

/* Animation Utilities */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in {
    animation: fadeInUp 0.6s ease forwards;
}