:root {
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --bg-color: #f8fafc;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --card-bg: rgba(255, 255, 255, 0.7);
    --border-color: rgba(255, 255, 255, 0.4);
    --shadow-soft: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-medium: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-large: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Prompt', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    justify-content: center;
    position: relative;
}

/* ========== Extravagant Hospital Loading Screen ========== */
.loader-overlay {
    position: fixed;
    inset: 0;
    background: radial-gradient(circle at center, #1e293b 0%, #0f172a 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: all 0.6s cubic-bezier(0.645, 0.045, 0.355, 1);
}

.loader-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    transform: scale(1.1);
    backdrop-filter: blur(20px);
}

.loader-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 90%;
    max-width: 400px;
    gap: 30px;
}

/* Medical Icon & Pulsing Rings */
.pulse-container {
    position: relative;
    width: 120px;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.main-icon {
    font-size: 3.5rem;
    color: #ff4d4d;
    z-index: 10;
    filter: drop-shadow(0 0 15px rgba(255, 77, 77, 0.6));
    animation: heartbeat 1.2s ease-in-out infinite;
}

.ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 2px solid #ff4d4d;
    border-radius: 50%;
    opacity: 0;
    animation: ring-pulse 2s ease-out infinite;
}

.ring:nth-child(2) { animation-delay: 0.5s; }
.ring:nth-child(3) { animation-delay: 1s; }

/* ECG Animation */
.ecg-box {
    width: 100%;
    height: 60px;
    overflow: hidden;
    position: relative;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.ecg-svg {
    width: 100%;
    height: 100%;
}

.ecg-line {
    fill: none;
    stroke: #00f2ff;
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    animation: ecg-draw 2.5s linear infinite;
    filter: drop-shadow(0 0 5px #00f2ff);
}

/* Info & Progress Bar */
.loading-info {
    text-align: center;
    width: 100%;
}

.hospital-brand-text {
    font-size: 1.5rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 15px;
    letter-spacing: 2px;
    text-transform: uppercase;
    background: linear-gradient(90deg, #fff, #6366f1, #fff);
    background-size: 200%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shine 3s linear infinite;
}

/* Subtle Digital Scanline Overlay */
.loader-overlay::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.1) 50%), 
                linear-gradient(90deg, rgba(255, 0, 0, 0.02), rgba(0, 255, 0, 0.01), rgba(0, 0, 255, 0.02));
    background-size: 100% 4px, 3px 100%;
    z-index: 1;
    pointer-events: none;
    opacity: 0.3;
}

.progress-container {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #6366f1, #00f2ff);
    box-shadow: 0 0 10px #6366f1;
    animation: fill-bar 2s ease-in-out infinite;
}

.loader-text {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.85rem;
    font-weight: 300;
}

/* Animations Keyframes */
@keyframes heartbeat {
    0%, 100% { transform: scale(1); }
    15% { transform: scale(1.15); }
    30% { transform: scale(1); }
    45% { transform: scale(1.25); }
    60% { transform: scale(1); }
}

@keyframes ring-pulse {
    0% { transform: scale(0.5); opacity: 0; }
    50% { opacity: 0.5; }
    100% { transform: scale(2); opacity: 0; }
}

@keyframes ecg-draw {
    0% { stroke-dashoffset: 1000; }
    100% { stroke-dashoffset: 0; }
}

@keyframes fill-bar {
    0% { width: 0%; transform: translateX(-100%); }
    50% { width: 70%; transform: translateX(0); }
    100% { width: 100%; transform: translateX(100%); }
}

@keyframes shine {
    to { background-position: 200% center; }
}


/* ========== Background Blobs ========== */
.background-blobs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.blob {
    position: absolute;
    width: 400px;
    height: 400px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(167, 139, 250, 0.1) 100%);
    filter: blur(80px);
    border-radius: 50%;
    animation: blobMove 15s infinite alternate ease-in-out;
}

.blob-1 {
    top: -100px;
    right: -100px;
}

.blob-2 {
    bottom: -100px;
    left: -100px;
    width: 500px;
    height: 500px;
    animation-duration: 20s;
}

.blob-3 {
    top: 40%;
    left: 30%;
    width: 300px;
    height: 300px;
    animation-duration: 18s;
}

@keyframes blobMove {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(50px, 100px) scale(1.1); }
}

/* ========== Container ========== */
.container {
    width: 100%;
    max-width: 520px;
    padding: 98px 20px 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 1;
}

/* ========== Header / Profile ========== */
.profile {
    text-align: center;
    margin-bottom: 40px;
    opacity: 0;
    animation: fadeIn 0.8s forwards;
}

.profile-img-container {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    padding: 4px;
    background: linear-gradient(135deg, #6366f1, #a78bfa);
    margin: 0 auto 20px;
    box-shadow: var(--shadow-large);
}

.profile-img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid white;
}

.profile-name {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
    line-height: 1.4;
}

.profile-bio {
    font-size: 0.95rem;
    color: var(--text-secondary);
    max-width: 320px;
    margin: 0 auto;
}

/* ========== Links Grid ========== */
.links-grid {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 14px;
    opacity: 0;
    animation: slideUp 0.8s 0.2s forwards;
}

.link-card {
    display: flex;
    align-items: center;
    padding: 18px 20px;
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 18px;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: var(--shadow-soft);
    /* Improve touch feedback */
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
}

.link-card:hover,
.link-card:focus-visible {
    transform: translateY(-5px) scale(1.02);
    box-shadow: var(--shadow-medium);
    border-color: rgba(99, 102, 241, 0.3);
    background: rgba(255, 255, 255, 0.9);
    outline: none;
}

/* Active state for touch devices */
.link-card:active {
    transform: scale(0.97);
    box-shadow: var(--shadow-soft);
}

.link-icon {
    width: 48px;
    height: 48px;
    min-width: 48px;
    background: white;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: var(--primary-color);
    margin-right: 16px;
    box-shadow: var(--shadow-soft);
}

.link-text {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.link-title {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.link-desc {
    font-size: 0.78rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.link-arrow {
    font-size: 0.8rem;
    color: var(--text-secondary);
    opacity: 0.5;
    transition: transform 0.3s;
    margin-left: 10px;
    flex-shrink: 0;
}

.link-card:hover .link-arrow,
.link-card:focus-visible .link-arrow {
    transform: translateX(5px);
    opacity: 1;
    color: var(--primary-color);
}

/* Highlight Card */
.link-card.highlight {
    background: var(--primary-color);
    color: white;
    border: none;
}

.link-card.highlight:hover {
    background: var(--primary-hover);
}

.link-card.highlight .link-title,
.link-card.highlight .link-desc,
.link-card.highlight .link-icon {
    color: white;
}

.link-card.highlight .link-icon {
    background: rgba(255, 255, 255, 0.2);
}

.link-card.highlight .link-arrow {
    color: rgba(255, 255, 255, 0.8);
}

/* ========== Footer ========== */
.social-footer {
    margin-top: 50px;
    text-align: center;
    opacity: 0;
    animation: fadeIn 0.8s 0.6s forwards;
    width: 100%;
}

.social-icons {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
}

.social-icons a {
    font-size: 1.5rem;
    color: var(--text-secondary);
    transition: all 0.3s;
    width: 48px;
    height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255,255,255,0.7);
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--border-color);
}

.social-icons a:hover,
.social-icons a:focus-visible {
    transform: translateY(-4px);
    box-shadow: var(--shadow-medium);
    outline: none;
}

#btn-line:hover { color: #06c755; border-color: #06c755; }
#btn-tiktok:hover { color: #010101; border-color: #010101; }
#btn-facebook:hover { color: #1877f2; border-color: #1877f2; }
#btn-email:hover { color: #ea4335; border-color: #ea4335; }

.copyright {
    font-size: 0.78rem;
    color: var(--text-secondary);
    opacity: 0.7;
    padding: 0 10px;
    line-height: 1.8;
}

/* ========== Animations ========== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========== Responsive: Mobile ========== */
@media (max-width: 480px) {
    .container {
        padding: 78px 14px 40px;
    }

    .profile-img-container {
        width: 96px;
        height: 96px;
    }

    .profile-name {
        font-size: 1.15rem;
    }

    .profile-bio {
        font-size: 0.88rem;
    }

    .link-card {
        padding: 15px 16px;
        border-radius: 16px;
    }

    .link-icon {
        width: 44px;
        height: 44px;
        min-width: 44px;
        margin-right: 12px;
        font-size: 1.1rem;
    }

    .link-title {
        font-size: 0.9rem;
    }

    .link-desc {
        font-size: 0.74rem;
    }

    .social-icons {
        gap: 14px;
    }

    .social-icons a {
        width: 46px;
        height: 46px;
        font-size: 1.3rem;
    }

    /* LINE Popup smaller on mobile */
    .line-popup {
        width: 176px;
        left: 12px;
        bottom: 70px;
    }

    .line-qr-img {
        width: 110px;
        height: 110px;
    }
}

/* Very small screens */
@media (max-width: 360px) {
    .profile-name {
        font-size: 1rem;
    }

    .links-grid {
        gap: 10px;
    }
}

/* ========== Particle Canvas ========== */
.particle-canvas {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* ========== Floating Glows ========== */
.float-glow {
    position: fixed;
    width: 1px; height: 1px;
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
    animation: glowPulse 7s ease-in-out infinite;
}
.float-glow-1 {
    top: 20%; right: 10%;
    box-shadow: 0 0 120px 60px rgba(99, 102, 241, 0.08);
}
.float-glow-2 {
    bottom: 25%; left: 5%;
    box-shadow: 0 0 150px 70px rgba(167, 139, 250, 0.06);
    animation-duration: 9s;
    animation-direction: reverse;
}
@keyframes glowPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50%       { transform: scale(1.4); opacity: 0.5; }
}

/* ========== Ticker Bar ========== */
.ticker-bar {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 100;
    background: linear-gradient(90deg, rgba(99,102,241,0.93), rgba(139,92,246,0.93));
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    height: 36px;
    display: flex;
    align-items: center;
    overflow: hidden;
    box-shadow: 0 2px 20px rgba(99,102,241,0.3);
}
.ticker-content {
    display: flex;
    align-items: center;
    width: 100%; height: 100%;
    overflow: hidden;
}
.ticker-label {
    flex-shrink: 0;
    background: rgba(255,255,255,0.18);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0 14px;
    margin-right: 8px;
    border-right: 1px solid rgba(255,255,255,0.2);
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    height: 100%;
}
.ticker-track {
    overflow: hidden;
    flex: 1;
}
.ticker-track span {
    display: inline-block;
    animation: tickerScroll 30s linear infinite;
    color: rgba(255,255,255,0.92);
    font-size: 0.76rem;
    white-space: nowrap;
}
@keyframes tickerScroll {
    0%   { transform: translateX(100vw); }
    100% { transform: translateX(-100%); }
}

/* ========== Status Badge ========== */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: rgba(16,185,129,0.1);
    border: 1px solid rgba(16,185,129,0.3);
    color: #059669;
    font-size: 0.74rem;
    font-weight: 500;
    padding: 5px 16px;
    border-radius: 999px;
    margin-top: 14px;
    cursor: default;
}
.status-dot {
    width: 7px; height: 7px;
    min-width: 7px;
    background: #10b981;
    border-radius: 50%;
    animation: pulseDot 2s ease-in-out infinite;
}
@keyframes pulseDot {
    0%,100% { box-shadow: 0 0 0 0 rgba(16,185,129,0.5); }
    50%     { box-shadow: 0 0 0 6px rgba(16,185,129,0); }
}

/* Closed state */
.status-badge.closed {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
}
.status-badge.closed .status-dot {
    background: #ef4444;
    animation: none;
}

/* ========== Section Divider ========== */
.section-divider {
    width: 50px;
    height: 3px;
    background: linear-gradient(90deg, #6366f1, #a78bfa);
    border-radius: 999px;
    margin: 24px auto 20px;
    opacity: 0;
    animation: fadeIn 0.8s 0.15s forwards;
}

/* ========== Stats Row ========== */
.stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    width: 100%;
    margin-bottom: 28px;
    opacity: 0;
    animation: slideUp 0.8s 0.1s forwards;
}
.stat-card {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 18px 10px 14px;
    text-align: center;
    box-shadow: var(--shadow-soft);
    transition: transform 0.3s cubic-bezier(0.175,0.885,0.32,1.275), box-shadow 0.3s ease;
}
.stat-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: var(--shadow-medium);
}
.stat-icon {
    font-size: 1.3rem;
    color: var(--primary-color);
    margin-bottom: 8px;
    display: block;
    filter: drop-shadow(0 0 6px rgba(99,102,241,0.35));
}
.stat-number {
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1;
    margin-bottom: 5px;
    background: linear-gradient(135deg, #6366f1, #a78bfa);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.stat-label {
    font-size: 0.66rem;
    color: var(--text-secondary);
    letter-spacing: 0.3px;
}

/* ========== Card Badges ========== */
.link-card { position: relative; overflow: visible; }
.card-badge {
    position: absolute;
    top: -9px; right: 18px;
    font-size: 0.62rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 999px;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    pointer-events: none;
}
.official-badge {
    background: linear-gradient(135deg, #6366f1, #a78bfa);
    color: #fff;
    box-shadow: 0 2px 10px rgba(99,102,241,0.5);
}
.new-badge {
    background: linear-gradient(135deg, #f59e0b, #f97316);
    color: #fff;
    box-shadow: 0 2px 10px rgba(245,158,11,0.5);
}

/* ========== Profile Ring Animation ========== */
.profile-img-container {
    background: linear-gradient(135deg, #6366f1, #a78bfa, #38bdf8, #6366f1);
    background-size: 300% 300%;
    animation: gradientRotate 5s linear infinite;
}
@keyframes gradientRotate {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* ========== Section Links Stagger ========== */
.links-grid { overflow: visible; }
.link-card:nth-child(1) { animation: slideUp 0.7s 0.35s both; }
.link-card:nth-child(2) { animation: slideUp 0.7s 0.5s both; }
.link-card:nth-child(3) { animation: slideUp 0.7s 0.65s both; }

/* ========== Additional Mobile Responsive ========== */
@media (max-width: 480px) {
    .stats-row { gap: 8px; }
    .stat-card { padding: 14px 6px 10px; border-radius: 14px; }
    .stat-number { font-size: 1.2rem; }
    .stat-label { font-size: 0.6rem; }
    .stat-icon { font-size: 1.1rem; }
    .ticker-label { font-size: 0.65rem; padding: 0 10px; }
    .ticker-track span { font-size: 0.7rem; }
}