/* ============================================
   PUBLIC PORTAL CSS - REMPRO
   VERSION: 2.0.0
   ============================================ */

/* CSS Variables untuk konsistensi */
:root {
    --primary: #667eea;
    --primary-dark: #5a67d8;
    --secondary: #764ba2;
    --gradient: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    --light-bg: #f8f9fc;
    --card-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    --hover-shadow: 0 30px 50px rgba(0, 0, 0, 0.15);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --border-radius: 20px;
    --border-radius-sm: 12px;
}

/* Import Google Fonts - Modern Font */
@import url('https://fonts.googleapis.com/css2?family=Inter:opsz,wght@14..32,300;14..32,400;14..32,500;14..32,600;14..32,700&display=swap');

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--gradient);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow-x: hidden;
    color: #1a202c;
    line-height: 1.5;
}

/* Animated Particle Background - Lebih Halus */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: radial-gradient(circle at 2px 2px, rgba(255,255,255,0.12) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
    z-index: 0;
    animation: particleMove 40s linear infinite;
}

@keyframes particleMove {
    0% { background-position: 0 0; }
    100% { background-position: 40px 40px; }
}

/* Efek overlay gradien untuk kedalaman */
body::after {
    content: '';
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at 30% 40%, rgba(255,255,255,0.08) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

/* Container Overlay */
.container, .navbar, footer {
    position: relative;
    z-index: 2;
}

/* ============================================
   NAVBAR
   ============================================ */
.navbar {
    backdrop-filter: blur(12px);
    background: rgba(0, 0, 0, 0.2) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    padding: 0.8rem 0;
    transition: var(--transition);
}

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

.navbar-logo {
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
    transition: transform 0.2s ease;
}

.navbar-logo:hover {
    transform: scale(1.03);
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.4rem;
    letter-spacing: -0.5px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    color: white !important;
}

.btn-outline-light {
    border-width: 1.5px;
    border-radius: 30px;
    padding: 0.5rem 1.2rem;
    font-weight: 500;
    transition: var(--transition);
}

.btn-outline-light:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    background-color: rgba(255,255,255,0.15);
}

/* ============================================
   SEARCH CARD
   ============================================ */
.search-card {
    background: rgba(255, 255, 255, 0.98);
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    overflow: hidden;
    transition: var(--transition);
    margin-bottom: 2rem;
}

.search-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--hover-shadow);
}

.search-header {
    background: var(--gradient);
    color: white;
    padding: 2rem 1.5rem;
    text-align: center;
}

.instansi-logo {
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.2));
    background: white;
    padding: 6px;
    border-radius: 50%;
    transition: transform 0.2s;
}

.instansi-logo:hover {
    transform: scale(1.02);
}

.search-header h2 {
    font-weight: 700;
    font-size: 1.8rem;
    margin: 1rem 0 0.5rem;
    letter-spacing: -0.3px;
}

.search-header p {
    font-size: 0.95rem;
    opacity: 0.9;
    margin-bottom: 0;
}

.search-body {
    padding: 2rem;
}

/* Input Group */
.input-group-text {
    border-top-left-radius: var(--border-radius-sm);
    border-bottom-left-radius: var(--border-radius-sm);
    background-color: #f1f5f9;
    border: 1px solid #e2e8f0;
    color: var(--primary);
}

.form-control {
    border-top-right-radius: var(--border-radius-sm);
    border-bottom-right-radius: var(--border-radius-sm);
    padding: 0.8rem 1.2rem;
    font-size: 1rem;
    border: 1px solid #e2e8f0;
    transition: var(--transition);
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
    outline: none;
}

.btn-search {
    background: var(--gradient);
    color: white;
    border: none;
    padding: 0.8rem;
    border-radius: var(--border-radius-sm);
    font-weight: 600;
    transition: var(--transition);
    width: 100%;
    font-size: 1rem;
}

.btn-search:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

.format-hint {
    font-size: 0.8rem;
    color: #4a5568;
    background: rgba(0,0,0,0.03);
    padding: 0.5rem;
    border-radius: 12px;
    display: inline-block;
}

.example-badge {
    background: #e2e8f0;
    padding: 0.2rem 0.7rem;
    border-radius: 20px;
    margin-right: 0.5rem;
    font-size: 0.7rem;
    font-weight: 500;
    color: #2d3748;
}

/* ============================================
   RESULT CARD
   ============================================ */
.result-card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    overflow: hidden;
    margin-top: 1.5rem;
}

.card-header {
    background: var(--gradient);
    border-bottom: none;
    padding: 1rem 1.5rem;
}

.card-header h5 {
    font-weight: 600;
    letter-spacing: -0.2px;
}

.card-header small {
    font-size: 0.8rem;
    font-weight: normal;
    opacity: 0.9;
}

.patient-info {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    padding: 1.5rem;
    border-radius: 1rem;
    margin-bottom: 1.5rem;
    transition: var(--transition);
}

.patient-info:hover {
    transform: scale(1.01);
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.info-icon {
    width: 60px;
    height: 60px;
    background: var(--gradient);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    box-shadow: 0 10px 15px -5px rgba(0,0,0,0.1);
    margin-bottom: 0.5rem;
}

.patient-info h5 {
    font-weight: 700;
    margin-bottom: 0.25rem;
}

/* Table Styles */
.table {
    border-radius: 1rem;
    overflow: hidden;
    margin-bottom: 0;
}

.table thead th {
    background-color: #f8fafc;
    border-bottom: 2px solid #e2e8f0;
    font-weight: 600;
    color: #1e293b;
    padding: 1rem;
}

.table tbody tr:hover {
    background-color: rgba(102, 126, 234, 0.05);
}

.table td {
    padding: 0.75rem;
    vertical-align: middle;
}

/* Nav Tabs */
.nav-tabs {
    border-bottom: 1px solid #e2e8f0;
    gap: 0.5rem;
}

.nav-tabs .nav-link {
    border: none;
    color: #475569;
    font-weight: 600;
    padding: 0.7rem 1.5rem;
    border-radius: 40px;
    transition: var(--transition);
}

.nav-tabs .nav-link:hover {
    color: var(--primary);
    background: rgba(102, 126, 234, 0.1);
}

.nav-tabs .nav-link.active {
    color: var(--primary);
    background: rgba(102, 126, 234, 0.15);
    border-bottom: none;
}

/* Badge Status */
.badge-status {
    padding: 0.3rem 0.8rem;
    border-radius: 30px;
    font-weight: 600;
    font-size: 0.7rem;
    display: inline-block;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.badge-aktif {
    background-color: #c6f6d5;
    color: #22543d;
}

.badge-tidak-aktif {
    background-color: #fed7d7;
    color: #742a2a;
}

.badge-libur {
    background-color: #feebc8;
    color: #7b341e;
}

.badge-secondary {
    background-color: #e2e8f0;
    color: #2d3748;
}

/* Alert */
.alert {
    border-radius: 1rem;
    border: none;
    padding: 1rem 1.2rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.alert-light {
    background-color: #f8fafc;
    border-left: 4px solid var(--primary);
}

/* ============================================
   FOOTER (STICKY) - Didukung struktur HTML
   ============================================ */
footer {
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    color: white;
    text-align: center;
    padding: 1.5rem 0;
    margin-top: 3rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 0.85rem;
}

footer p {
    margin-bottom: 0.3rem;
}

/* ============================================
   RESPONSIVE ADJUSTMENTS
   ============================================ */
@media (max-width: 992px) {
    .search-header h2 {
        font-size: 1.5rem;
    }
}

@media (max-width: 768px) {
    .search-header {
        padding: 1.5rem;
    }
    .search-header h2 {
        font-size: 1.3rem;
    }
    .search-body {
        padding: 1.5rem;
    }
    .btn-search {
        margin-top: 0.5rem;
    }
    .patient-info {
        padding: 1rem;
    }
    .info-icon {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
    }
    .nav-tabs .nav-link {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }
    .table {
        font-size: 0.8rem;
    }
    .table td, .table th {
        white-space: nowrap;
    }
    .navbar-brand {
        font-size: 1.2rem;
    }
    .navbar-logo {
        height: 32px;
    }
    .instansi-logo {
        height: 50px;
    }
}

@media (max-width: 576px) {
    .search-header h2 {
        font-size: 1.1rem;
    }
    .search-header p {
        font-size: 0.8rem;
    }
    .form-control, .btn-search {
        font-size: 0.85rem;
        padding: 0.7rem;
    }
    .badge-status {
        font-size: 0.65rem;
        padding: 0.2rem 0.5rem;
    }
    .card-header h5 {
        font-size: 1rem;
    }
    .patient-info h5 {
        font-size: 1rem;
    }
    footer {
        font-size: 0.7rem;
        padding: 1rem;
    }
}

/* ============================================
   UTILITIES & ANIMATIONS
   ============================================ */
.animate__animated {
    animation-duration: 0.6s;
}

.animate__fadeInUp {
    animation-name: fadeInUp;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translate3d(0, 30px, 0);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

.animate__shakeX {
    animation-name: shakeX;
}

@keyframes shakeX {
    from, to {
        transform: translate3d(0, 0, 0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translate3d(-5px, 0, 0);
    }
    20%, 40%, 60%, 80% {
        transform: translate3d(5px, 0, 0);
    }
}

/* Hover effect for cards */
.result-card, .search-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Print styles - Untuk kebutuhan cetak */
@media print {
    body {
        background: white;
        color: black;
    }
    .navbar, .btn-search, .alert, footer, .format-hint {
        display: none;
    }
    .result-card, .search-card {
        box-shadow: none;
        border: 1px solid #ccc;
    }
    .card-header {
        background: #f0f0f0;
        color: black;
    }
}