/* =====================================================
   CUSTOM CSS - PUSKESMAS GUNUNG LABUHAN
   ===================================================== */

/* --- Scrollbar --- */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

.dark ::-webkit-scrollbar-track {
    background: #0f172a;
}

::-webkit-scrollbar-thumb {
    background: #10b981;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #059669;
}

/* --- Selection --- */
::selection {
    background-color: rgba(16, 185, 129, 0.2);
    color: #065f46;
}

.dark ::selection {
    background-color: rgba(16, 185, 129, 0.3);
    color: #6ee7b7;
}

/* --- Smooth Scroll --- */
html {
    scroll-behavior: smooth;
}

/* --- Body --- */
body {
    overflow-x: hidden;
}

/* --- Glassmorphism --- */
.glass {
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.dark .glass {
    background: rgba(15, 23, 42, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* --- Animations --- */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-10px);
    }
}

@keyframes pulse-ring {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

@keyframes countUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-up {
    animation: fadeInUp 0.7s ease-out forwards;
}

.animate-fade-down {
    animation: fadeInDown 0.7s ease-out forwards;
}

.animate-fade-left {
    animation: fadeInLeft 0.7s ease-out forwards;
}

.animate-fade-right {
    animation: fadeInRight 0.7s ease-out forwards;
}

.animate-scale-in {
    animation: scaleIn 0.5s ease-out forwards;
}

.animate-float {
    animation: float 3s ease-in-out infinite;
}

/* --- Scroll Animation Initial State --- */
.scroll-hidden {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.scroll-hidden.visible {
    opacity: 1;
    transform: translateY(0);
}

.scroll-hidden.delay-1 {
    transition-delay: 0.1s;
}

.scroll-hidden.delay-2 {
    transition-delay: 0.2s;
}

.scroll-hidden.delay-3 {
    transition-delay: 0.3s;
}

.scroll-hidden.delay-4 {
    transition-delay: 0.4s;
}

.scroll-hidden.delay-5 {
    transition-delay: 0.5s;
}

/* --- Navbar Scroll --- */
.nav-scrolled {
    background: rgba(255, 255, 255, 0.92) !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.dark .nav-scrolled {
    background: rgba(15, 23, 42, 0.92) !important;
}

.nav-scrolled .nav-link-home {
    color: #475569 !important;
}

.dark .nav-scrolled .nav-link-home {
    color: #e2e8f0 !important;
}

/* --- Hero Gradient --- */
.hero-gradient {
    background: linear-gradient(135deg, #059669 0%, #047857 30%, #065F46 60%, #0369A1 100%);
}

.hero-pattern {
    background-image: radial-gradient(circle at 20% 80%, rgba(16, 185, 129, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(14, 165, 233, 0.15) 0%, transparent 50%);
}

/* --- Card Hover Effects --- */
.card-hover {
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.card-hover:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 40px -12px rgba(0, 0, 0, 0.15);
}

.dark .card-hover:hover {
    box-shadow: 0 20px 40px -12px rgba(0, 0, 0, 0.4);
}

/* --- Service Card Icon --- */
.service-icon {
    transition: all 0.3s ease;
}

.card-hover:hover .service-icon {
    transform: scale(1.1) rotate(5deg);
}

/* --- Stat Counter --- */
.stat-number {
    font-variant-numeric: tabular-nums;
}

/* --- Testimonial Card --- */
.testimonial-card {
    position: relative;
}

.testimonial-card::before {
    content: '\201C';
    position: absolute;
    top: -10px;
    left: 20px;
    font-size: 80px;
    line-height: 1;
    color: rgba(16, 185, 129, 0.1);
    font-family: Georgia, serif;
}

/* --- Table Modern --- */
.table-modern {
    border-collapse: separate;
    border-spacing: 0;
}

.table-modern thead th {
    background: linear-gradient(135deg, #059669, #047857);
    color: white;
    font-weight: 600;
    padding: 14px 16px;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.table-modern thead th:first-child {
    border-radius: 12px 0 0 0;
}

.table-modern thead th:last-child {
    border-radius: 0 12px 0 0;
}

.table-modern tbody tr {
    transition: all 0.2s ease;
}

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

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

.table-modern tbody td {
    padding: 12px 16px;
    border-bottom: 1px solid #e2e8f0;
    font-size: 0.875rem;
}

.dark .table-modern tbody td {
    border-bottom-color: #1e293b;
}

/* --- Form Input Modern --- */
.form-input-modern {
    transition: all 0.3s ease;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 0.9rem;
    width: 100%;
    background: white;
}

.dark .form-input-modern {
    border-color: #334155;
    background: #1e293b;
    color: #e2e8f0;
}

.form-input-modern:focus {
    outline: none;
    border-color: #10b981;
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.15);
}

.form-input-modern::placeholder {
    color: #94a3b8;
}

/* --- Honeypot (Hidden) --- */
.hp-field {
    position: absolute;
    left: -9999px;
    opacity: 0;
    height: 0;
    width: 0;
    overflow: hidden;
    pointer-events: none;
    tab-index: -1;
}

/* --- Badge --- */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* --- Pulse Dot --- */
.pulse-dot {
    position: relative;
}

.pulse-dot::after {
    content: '';
    position: absolute;
    top: -2px;
    right: -2px;
    width: 10px;
    height: 10px;
    background: #10b981;
    border-radius: 50%;
    border: 2px solid white;
}

.dark .pulse-dot::after {
    border-color: #0f172a;
}

.pulse-dot::before {
    content: '';
    position: absolute;
    top: -2px;
    right: -2px;
    width: 10px;
    height: 10px;
    background: #10b981;
    border-radius: 50%;
    animation: pulse-ring 1.5s ease-out infinite;
}

/* --- WhatsApp Button --- */
#waFloat.visible {
    opacity: 1;
    transform: translateY(0);
}

/* --- Toast --- */
.toast-show {
    display: block !important;
    transform: translateX(0) !important;
}

/* --- Dark Mode Transitions --- */
*,
*::before,
*::after {
    transition-property: background-color, border-color, color;
    transition-duration: 0ms;
}

.dark-mode-ready *,
.dark-mode-ready *::before,
.dark-mode-ready *::after {
    transition-duration: 200ms;
}

/* --- Print Styles --- */
@media print {

    nav,
    footer,
    #waFloat,
    #toast {
        display: none !important;
    }

    main {
        padding-top: 0 !important;
    }
}