/* ============================================
   POSYANDU DETAIL CSS - COMPREHENSIVE STYLING
   Untuk semua halaman detail: Kaders, Health Records, Immunizations,
   Ibu Hamil, Locations, Nutrition Data, Patient Types, Schedules, Stunting Data
   ============================================ */

/* ===== ROOT VARIABLES ===== */
:root {
    /* Primary Colors */
    --detail-primary: #667eea;
    --detail-primary-dark: #764ba2;
    --detail-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    
    /* Status Colors */
    --status-success: #28a745;
    --status-success-bg: #d4edda;
    --status-success-border: #c3e6cb;
    
    --status-danger: #dc3545;
    --status-danger-bg: #f8d7da;
    --status-danger-border: #f5c6cb;
    
    --status-warning: #ffc107;
    --status-warning-bg: #fff3cd;
    --status-warning-border: #ffeaa7;
    
    --status-info: #17a2b8;
    --status-info-bg: #d1ecf1;
    --status-info-border: #bee5eb;
    
    /* Neutral Colors */
    --white: #ffffff;
    --light-gray: #f8f9fa;
    --medium-gray: #e9ecef;
    --border-gray: #dee2e6;
    --text-gray: #6c757d;
    --text-dark: #495057;
    --text-black: #343a40;
    
    /* Shadows */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 25px rgba(0, 0, 0, 0.15);
    --shadow-xl: 0 10px 30px rgba(0, 0, 0, 0.2);
    
    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 10px;
    --radius-lg: 15px;
    --radius-xl: 20px;
    --radius-full: 50%;
    
    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 2.5rem;
}

/* ===== CONTAINER ===== */
.detail-container {
    padding: var(--spacing-md);
    min-height: 100vh;
    background: linear-gradient(135deg, #f0f4ff 0%, #faf9ff 100%);
}

/* ===== HEADER SECTIONS ===== */
.detail-header,
.profile-card {
    background: var(--detail-gradient);
    color: var(--white);
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    margin-bottom: var(--spacing-xl);
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(102, 126, 234, 0.3);
}

.detail-header::before,
.profile-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(180deg); }
}

.detail-header h1,
.profile-card h2 {
    position: relative;
    z-index: 2;
    font-weight: 700;
    margin-bottom: var(--spacing-sm);
}

.detail-header p,
.profile-card p {
    position: relative;
    z-index: 2;
    opacity: 0.9;
    margin: 0;
}

/* ===== PROFILE PHOTO ===== */
.profile-photo,
.patient-photo {
    width: 150px;
    height: 150px;
    border-radius: var(--radius-full);
    object-fit: cover;
    border: 5px solid rgba(255,255,255,0.3);
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
    position: relative;
    z-index: 2;
    margin-bottom: var(--spacing-md);
}

.profile-photo.small,
.patient-photo.small {
    width: 100px;
    height: 100px;
}

/* ===== INFO CARDS ===== */
.info-card,
.patient-info-card,
.medical-info-section,
.detail-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    margin-bottom: var(--spacing-xl);
    box-shadow: var(--shadow-md);
    border-left: 5px solid var(--detail-primary);
    transition: all 0.3s ease;
}

.info-card:hover,
.patient-info-card:hover,
.medical-info-section:hover,
.detail-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.info-card.success { border-left-color: var(--status-success); }
.info-card.warning { border-left-color: var(--status-warning); }
.info-card.danger { border-left-color: var(--status-danger); }
.info-card.info { border-left-color: var(--status-info); }

.info-card h6,
.section-title {
    color: var(--text-dark);
    font-weight: 600;
    margin-bottom: var(--spacing-lg);
    padding-bottom: var(--spacing-sm);
    border-bottom: 2px solid var(--medium-gray);
}

/* ===== INFO TABLE ===== */
.info-table {
    width: 100%;
    margin-bottom: 0;
}

.info-table td {
    padding: var(--spacing-sm) 0;
    border: none;
    vertical-align: top;
}

.info-table td:first-child {
    font-weight: 600;
    color: var(--text-gray);
    width: 40%;
}

.info-table td:last-child {
    color: var(--text-dark);
}

/* ===== INFO ITEMS ===== */
.info-item {
    margin-bottom: var(--spacing-md);
}

.info-label {
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: var(--spacing-xs);
    display: block;
}

.info-value {
    color: var(--text-gray);
    line-height: 1.5;
}

/* ===== STATUS BADGES ===== */
.status-badge {
    display: inline-block;
    padding: 8px 16px;
    border-radius: var(--radius-xl);
    font-weight: 500;
    font-size: 0.9rem;
}

.status-aktif,
.status-badge.active {
    background: var(--status-success-bg);
    color: #155724;
    border: 1px solid var(--status-success-border);
}

.status-nonaktif,
.status-badge.inactive {
    background: var(--status-danger-bg);
    color: #721c24;
    border: 1px solid var(--status-danger-border);
}

.status-cuti,
.status-badge.pending {
    background: var(--status-warning-bg);
    color: #856404;
    border: 1px solid var(--status-warning-border);
}

.status-badge.completed {
    background: var(--status-success-bg);
    color: #155724;
    border: 1px solid var(--status-success-border);
}

/* ===== JABATAN BADGE ===== */
.jabatan-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: var(--radius-xl);
    font-size: 0.85rem;
    font-weight: 500;
}

.jabatan-badge.ketua { background: #e8f5e8; color: #2e7d32; }
.jabatan-badge.wakil_ketua { background: #e3f2fd; color: #1976d2; }
.jabatan-badge.sekretaris { background: #fff3e0; color: #f57c00; }
.jabatan-badge.bendahara { background: #fce4ec; color: #c2185b; }
.jabatan-badge.anggota { background: #e3f2fd; color: #1976d2; }

/* ===== VITAL SIGNS GRID ===== */
.vital-signs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
}

.vital-sign-card {
    background: var(--light-gray);
    border-radius: var(--radius-sm);
    padding: var(--spacing-lg);
    text-align: center;
    border-left: 4px solid var(--detail-primary);
    transition: all 0.3s ease;
}

.vital-sign-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.vital-sign-value {
    font-size: 2rem;
    font-weight: bold;
    color: var(--detail-primary);
    margin-bottom: var(--spacing-xs);
}

.vital-sign-label {
    color: var(--text-gray);
    font-size: 0.9rem;
    font-weight: 500;
}

.vital-sign-card.success { border-left-color: var(--status-success); }
.vital-sign-card.success .vital-sign-value { color: var(--status-success); }

.vital-sign-card.warning { border-left-color: var(--status-warning); }
.vital-sign-card.warning .vital-sign-value { color: var(--status-warning); }

.vital-sign-card.danger { border-left-color: var(--status-danger); }
.vital-sign-card.danger .vital-sign-value { color: var(--status-danger); }

/* ===== TIMELINE ===== */
.timeline {
    position: relative;
    padding-left: 30px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 15px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border-gray);
}

.timeline-item {
    position: relative;
    margin-bottom: var(--spacing-lg);
    background: var(--white);
    border-radius: var(--radius-sm);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-sm);
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -22px;
    top: 15px;
    width: 12px;
    height: 12px;
    border-radius: var(--radius-full);
    background: var(--detail-primary);
    border: 3px solid var(--white);
    box-shadow: 0 0 0 3px var(--border-gray);
}

.timeline-time {
    font-size: 0.8rem;
    color: var(--text-gray);
    margin-bottom: var(--spacing-xs);
}

.timeline-title {
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: var(--spacing-xs);
}

.timeline-description {
    color: var(--text-gray);
    font-size: 0.9rem;
    line-height: 1.5;
}

/* ===== ACTIVITY LOG ===== */
.activity-log {
    background: var(--white);
    border-radius: var(--radius-md);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
    box-shadow: var(--shadow-sm);
}

.activity-item {
    padding: var(--spacing-md);
    border-bottom: 1px solid var(--medium-gray);
    display: flex;
    align-items: start;
    gap: var(--spacing-md);
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    background: var(--detail-gradient);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.activity-content {
    flex: 1;
}

.activity-title {
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: var(--spacing-xs);
}

.activity-time {
    font-size: 0.85rem;
    color: var(--text-gray);
}

/* ===== STATISTICS GRID ===== */
.stats-grid-detail {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
}

.stat-card-detail {
    background: var(--white);
    border-radius: var(--radius-md);
    padding: var(--spacing-lg);
    text-align: center;
    box-shadow: var(--shadow-sm);
    border-top: 4px solid var(--detail-primary);
}

.stat-card-detail .stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--detail-primary);
    margin-bottom: var(--spacing-xs);
}

.stat-card-detail .stat-label {
    color: var(--text-gray);
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ===== ACTION BUTTONS ===== */
.action-buttons {
    display: flex;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
    margin-top: var(--spacing-lg);
}

.action-buttons.sticky {
    position: sticky;
    top: 20px;
    z-index: 1000;
    background: var(--white);
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
}

.btn-action-detail {
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.btn-action-detail:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-edit {
    background: linear-gradient(135deg, #ffc107 0%, #ff9800 100%);
    color: var(--white);
}

.btn-delete {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: var(--white);
}

.btn-back {
    background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%);
    color: var(--white);
}

.btn-print {
    background: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
    color: var(--white);
}

/* ===== CONTACT INFO ===== */
.contact-info-detail {
    background: var(--light-gray);
    border-radius: var(--radius-sm);
    padding: var(--spacing-md);
    margin-top: var(--spacing-md);
}

.contact-item-detail {
    display: flex;
    align-items: center;
    margin-bottom: var(--spacing-sm);
    padding: var(--spacing-xs) 0;
}

.contact-item-detail:last-child {
    margin-bottom: 0;
}

.contact-item-detail i {
    width: 24px;
    color: var(--detail-primary);
    margin-right: var(--spacing-sm);
    flex-shrink: 0;
}

.contact-item-detail span {
    color: var(--text-dark);
    font-size: 0.95rem;
}

/* ===== SKILLS & TAGS ===== */
.skills-section,
.tags-section {
    background: var(--status-info-bg);
    border-radius: var(--radius-sm);
    padding: var(--spacing-md);
    margin-top: var(--spacing-md);
}

.skill-tag,
.tag-item {
    display: inline-block;
    padding: 6px 12px;
    border-radius: var(--radius-xl);
    font-size: 0.85rem;
    font-weight: 500;
    margin: 4px;
    background: #bbdefb;
    color: #1976d2;
}

/* ===== LOCATION INFO ===== */
.location-map {
    background: var(--light-gray);
    border-radius: var(--radius-sm);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
    text-align: center;
    min-height: 300px;
}

.map-placeholder {
    width: 100%;
    height: 300px;
    background: var(--medium-gray);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-gray);
    font-size: 1.1rem;
}

.coordinates-info {
    background: var(--white);
    border-radius: var(--radius-sm);
    padding: var(--spacing-md);
    margin-top: var(--spacing-md);
    border: 2px solid var(--border-gray);
}

/* ===== AMENITIES LIST ===== */
.amenities-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.amenity-item-detail {
    display: flex;
    align-items: center;
    padding: var(--spacing-sm) 0;
    border-bottom: 1px solid var(--medium-gray);
}

.amenity-item-detail:last-child {
    border-bottom: none;
}

.amenity-item-detail i {
    width: 24px;
    color: var(--status-success);
    margin-right: var(--spacing-sm);
}

/* ===== SCHEDULE DETAILS ===== */
.schedule-details-section {
    background: var(--light-gray);
    border-radius: var(--radius-sm);
    padding: var(--spacing-lg);
    margin-top: var(--spacing-md);
}

.participants-list {
    background: var(--white);
    border-radius: var(--radius-sm);
    padding: var(--spacing-md);
    margin-top: var(--spacing-md);
}

.participant-item {
    display: flex;
    align-items: center;
    padding: var(--spacing-sm);
    border-bottom: 1px solid var(--medium-gray);
}

.participant-item:last-child {
    border-bottom: none;
}

.participant-avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    background: var(--detail-gradient);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: var(--spacing-sm);
    font-weight: 700;
}

/* ===== MEDICAL NOTES ===== */
.medical-notes {
    background: var(--light-gray);
    border-radius: var(--radius-sm);
    padding: var(--spacing-lg);
    margin-top: var(--spacing-md);
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-dark);
}

.diagnosis-section,
.prescription-section {
    background: var(--white);
    border-radius: var(--radius-sm);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
    border-left: 4px solid var(--status-info);
}

/* ===== ALERTS ===== */
.alert-detail {
    border-radius: var(--radius-md);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
    border: none;
    box-shadow: var(--shadow-sm);
}

.alert-detail-success {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    color: #155724;
    border-left: 5px solid var(--status-success);
}

.alert-detail-warning {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    color: #856404;
    border-left: 5px solid var(--status-warning);
}

.alert-detail-danger {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    color: #721c24;
    border-left: 5px solid var(--status-danger);
}

.alert-detail-info {
    background: linear-gradient(135deg, #d1ecf1 0%, #bee5eb 100%);
    color: #0c5460;
    border-left: 5px solid var(--status-info);
}

/* ===== RESPONSIVE DESIGN ===== */
/* Tablet (768px - 991px) */
@media (min-width: 768px) and (max-width: 991px) {
    .detail-header h1,
    .profile-card h2 {
        font-size: 2rem;
    }
    
    .vital-signs-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Mobile (max-width: 767px) */
@media (max-width: 767px) {
    .detail-container {
        padding: var(--spacing-sm);
    }
    
    .detail-header,
    .profile-card {
        padding: var(--spacing-lg);
        margin-bottom: var(--spacing-lg);
    }
    
    .detail-header h1,
    .profile-card h2 {
        font-size: 1.5rem;
    }
    
    .profile-photo,
    .patient-photo {
        width: 100px;
        height: 100px;
    }
    
    .info-card,
    .patient-info-card,
    .medical-info-section,
    .detail-card {
        padding: var(--spacing-md);
    }
    
    .vital-signs-grid,
    .stats-grid-detail {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-sm);
    }
    
    .vital-sign-value {
        font-size: 1.5rem;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .btn-action-detail {
        width: 100%;
    }
    
    .info-table td:first-child {
        width: 50%;
    }
}

/* Extra Small Mobile (max-width: 480px) */
@media (max-width: 480px) {
    .detail-header h1,
    .profile-card h2 {
        font-size: 1.25rem;
    }
    
    .vital-sign-value {
        font-size: 1.25rem;
    }
    
    .info-table td {
        display: block;
        width: 100% !important;
        padding: var(--spacing-xs) 0;
    }
    
    .info-table td:first-child {
        font-weight: 600;
        margin-bottom: var(--spacing-xs);
    }
}

/* ===== PRINT STYLES ===== */
@media print {
    .action-buttons,
    .btn-action-detail {
        display: none !important;
    }
    
    .info-card,
    .patient-info-card,
    .medical-info-section,
    .detail-card {
        box-shadow: none !important;
        border: 1px solid var(--border-gray) !important;
        page-break-inside: avoid;
    }
    
    .detail-header,
    .profile-card {
        background: var(--white) !important;
        color: var(--text-black) !important;
        border: 2px solid var(--detail-primary) !important;
    }
}

/* ===== ANIMATIONS ===== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.info-card,
.patient-info-card,
.medical-info-section,
.detail-card {
    animation: fadeIn 0.5s ease-out;
}

/* ===== END OF POSYANDU DETAIL CSS ===== */

