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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f0f4f8;
    color: #333;
    text-align: center;
    padding: 20px;
}

h2 {
    margin-bottom: 20px;
    color: #1f2937;
}

.card {
    background: #fff;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.08);
    margin-bottom: 20px;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
    text-align: left;
}

/* Header dengan tanggal dan jam */
.header-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 0 5px;
    border-bottom: 2px solid #e5e7eb;
    padding-bottom: 10px;
}

#tanggal {
    font-weight: 600;
    font-size: 16px;
    color: #4b5563;
    margin: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Jam Live - Sejajar kanan dengan style sama */
#live-clock {
    font-size: 16px;
    font-weight: 600;
    color: #4b5563;
    background: #f3f4f6;
    padding: 4px 12px;
    border-radius: 20px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    border: 1px solid #e5e7eb;
    display: inline-block;
    margin: 0;
}

#live-clock span {
    font-size: 14px;
    color: #9ca3af;
    margin-left: 4px;
    font-weight: 400;
}

/* Judul Jadwal Hari Ini */
.card h3 {
    font-size: 18px;
    color: #1f2937;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e5e7eb;
}

/* Konten jadwal */
#jadwal {
    font-size: 15px;
    line-height: 1.8;
}

#jadwal > div {
    padding: 6px 0;
    border-bottom: 1px dashed #f0f0f0;
}

#jadwal > div:last-child {
    border-bottom: none;
}

/* Staff card base style - UNTUK 1 ORANG */
.staff-card {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 1px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.staff-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

/* Foto wrapper untuk efek hover dan klik */
.foto-wrapper {
    position: relative;
    width: 80px;
    height: 80px;
    cursor: pointer;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
}

.staff-foto {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #e5e7eb;
    transition: transform 0.3s ease;
}

.foto-wrapper:hover .staff-foto {
    transform: scale(1.1);
}

/* Overlay saat hover foto */
.foto-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.foto-wrapper:hover .foto-overlay {
    opacity: 1;
}

.foto-overlay span {
    color: white;
    font-size: 12px;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.staff-info {
    flex: 1;
}

.staff-info h3 {
    margin: 0 0 8px 0;
    font-size: 18px;
    color: #1f2937;
}

/* Shift info dengan badge dan jam */
.shift-info {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.shift-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    text-transform: capitalize;
    color: white;
}

/* Warna badge per shift */
.shift-badge.pagi {
    background: #f59e0b; /* orange */
}

.shift-badge.siang {
    background: #10b981; /* hijau */
}

.shift-badge.malam {
    background: #3b82f6; /* biru */
}

.shift-badge.libur {
    background: #9ca3af; /* abu-abu */
}

.shift-hours {
    font-size: 13px;
    color: #6b7280;
    background: #f3f4f6;
    padding: 4px 10px;
    border-radius: 20px;
    font-weight: 500;
}

.btn {
    display: inline-block;
    background: #25D366;
    padding: 8px 14px;
    border-radius: 6px;
    color: white;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: background 0.3s, transform 0.2s;
}

.btn:hover {
    background: #1ebc57;
    transform: scale(1.05);
}

/* Popup foto (style Instagram) */
.photo-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.popup-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    animation: zoomIn 0.3s ease;
}

@keyframes zoomIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.popup-content img {
    max-width: 100%;
    max-height: 80vh;
    border-radius: 8px;
    box-shadow: 0 5px 30px rgba(0,0,0,0.5);
}

.popup-caption {
    position: absolute;
    bottom: -30px;
    left: 0;
    right: 0;
    text-align: center;
    color: white;
    font-size: 16px;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.close-popup {
    position: absolute;
    top: -40px;
    right: -40px;
    color: white;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    transition: background 0.3s;
}

.close-popup:hover {
    background: rgba(255,255,255,0.3);
}

/* ===== RESPONSIVE UNTUK HP (1 ORANG) ===== */
@media(max-width: 720px) {
    .card {
        padding: 20px;
    }
    
    /* Style untuk 1 orang di HP */
    .staff-card {
        flex-direction: column;
        text-align: center;     
        
    }
    
    .staff-info {
        text-align: center;
    }
    
    .shift-info {
        justify-content: center;
    }
    
    .foto-wrapper {
        width: 100px;
        height: 100px;
    }
    
    .close-popup {
        top: -50px;
        right: 0;
    }
    
    .popup-caption {
        bottom: -40px;
    }
}

/* ===== TAMBAHAN UNTUK 2 ORANG ATAU LEBIH ===== */
/* Deteksi kalau ada minimal 2 staff di on duty */
#onduty:has(.staff-card:nth-child(2)) {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

/* Style untuk staff card saat ada 2 orang atau lebih */
#onduty:has(.staff-card:nth-child(2)) .staff-card {
    margin-bottom: 0;
    height: 100%;
    width: 95%;
    flex-direction: column;
    text-align: center;
    padding: 15px 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#onduty:has(.staff-card:nth-child(2)) .staff-card .foto-wrapper {
    width: 70px;
    height: 70px;
    margin: 0 auto 10px auto;
}

#onduty:has(.staff-card:nth-child(2)) .staff-card .staff-info {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

#onduty:has(.staff-card:nth-child(2)) .staff-card .staff-info h3 {
    font-size: 15px;
    margin: 0 0 8px 0;
    text-align: center;
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#onduty:has(.staff-card:nth-child(2)) .staff-card .shift-info {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0 0 10px 0;
    width: 100%;
}

#onduty:has(.staff-card:nth-child(2)) .staff-card .shift-badge {
    font-size: 11px;
    padding: 4px 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

#onduty:has(.staff-card:nth-child(2)) .staff-card .shift-hours {
    font-size: 10px;
    padding: 4px 8px;
    background: #e5e7eb;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

#onduty:has(.staff-card:nth-child(2)) .staff-card .btn {
    font-size: 12px;
    padding: 8px 0;
    width: 90%;
    margin: 0 auto;
    text-align: center;
    display: block;
}

/* Responsive untuk 2 orang di HP */
@media(max-width: 720px) {
    #onduty:has(.staff-card:nth-child(2)) {
        gap: 8px;
    }
    
    #onduty:has(.staff-card:nth-child(2)) .staff-card {
        padding: 12px 5px;
    }
    
    #onduty:has(.staff-card:nth-child(2)) .staff-card .foto-wrapper {
        width: 60px;
        height: 60px;
        margin-bottom: 8px;
    }
    
    #onduty:has(.staff-card:nth-child(2)) .staff-card .staff-info h3 {
        font-size: 13px;
        margin-bottom: 6px;
    }
    
    #onduty:has(.staff-card:nth-child(2)) .staff-card .shift-badge {
        font-size: 10px;
        padding: 3px 6px;
    }
    
    #onduty:has(.staff-card:nth-child(2)) .staff-card .shift-hours {
        font-size: 9px;
        padding: 3px 6px;
    }
    
    #onduty:has(.staff-card:nth-child(2)) .staff-card .btn {
        font-size: 11px;
        padding: 6px 0;
        width: 95%;
    }
}

/* Warna badge untuk cuti */
.shift-badge.cuti {
    background: #ef4444; /* warna merah */
}

/* Icon untuk cuti (opsional) */
.shift-badge.cuti::before {
    content: "🏥";
    margin-right: 4px;
}

/* Badge untuk pengganti cuti */
.shift-badge.pengganti {
    background: #8b5cf6; /* warna ungu */
    position: relative;
}

.shift-badge.pengganti::after {
    content: "🔄";
    margin-left: 5px;
    font-size: 11px;
}

/* Tooltip siapa yang digantikan */
.shift-badge.pengganti:hover::before {
    content: attr(data-menggantikan);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    white-space: nowrap;
    z-index: 10;
}

/* Badge untuk plug */
.shift-badge.plug1 {
    background: #8b5cf6; /* ungu */
}

.shift-badge.plug2 {
    background: #ec4899; /* pink */
}

/* Badge cuti */
.shift-badge.cuti {
    background: #ef4444; /* merah */
}


/* Popup Jadwal Bulanan */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.popup-container {
    background: white;
    border-radius: 20px;
    width: 90%;
    max-width: 95%;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}

.popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: #0284c7;
    color: white;
    border-radius: 20px 20px 0 0;
}

.popup-header h3 {
    margin: 0;
    font-size: 18px;
}

.popup-close {
    background: none;
    border: none;
    color: white;
    font-size: 28px;
    cursor: pointer;
    line-height: 1;
}

.popup-content {
    padding: 20px;
    overflow: hidden;
    height: calc(90vh - 120px);
}

.popup-footer {
    padding: 15px 20px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* eos/jadwal-bulanan/style.css - NO HORIZONTAL SCROLL */

.jadwal-container {
    background: white;
    border-radius: 20px;
    height: 100%;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.jadwal-title-sticky {
    flex-shrink: 0;
    background: white;
    padding: 14px 0;
    text-align: center;
    border-bottom: 1px solid #eef2ff;
    position: sticky;
    top: 0;
    z-index: 30;
}

.jadwal-title-sticky h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
}

/* HAPUS overflow-x: auto, tambah overflow-y only */
.jadwal-scroll {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
}

/* TABLE LEBAR 100%, GA ADA MIN-WIDTH */
.jadwal-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.jadwal-table th,
.jadwal-table td {
    padding: 10px 6px;
    text-align: center;
    vertical-align: middle;
}

/* HEADER */
.jadwal-table th {
    background: #f8fafc;
    font-weight: 600;
    color: #475569;
    font-size: 12px;
    border-bottom: 1px solid #e2e8f0;
}

/* KOLOM TANGGAL - STICKY KIRI */
.sticky-col {
    position: sticky;
    left: 0;
    background: white;
    font-weight: 600;
    min-width: 65px;
    z-index: 15;
    border-right: 1px solid #eef2ff;
}

.jadwal-table th.sticky-col {
    background: #f1f5f9;
    z-index: 25;
}

/* CELL TANGGAL */
.date-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.date-number {
    font-size: 14px;
    font-weight: 700;
    color: #0f172a;
}

.date-day {
    font-size: 9px;
    color: #94a3b8;
}

/* HEADER NAMA STAFF */
.sticky-header {
    background: #f8fafc;
    z-index: 100;
    font-weight: 600;
    color: #334155;
    font-size: 8px;
    white-space: nowrap;
}

/* CELL SHIFT */
.shift-text {
    font-weight: 500;
    font-size: 11px;
    display: inline-block;
    padding: 2px 4px;
    border-radius: 12px;
}

/* Warna shift */
.shift-pagi { background-color: #fef3c7; color: #92400e; }
.shift-siang { background-color: #d1fae5; color: #065f46; }
.shift-malam { background-color: #dbeafe; color: #1e3a8a; }
.shift-libur { background-color: #FFCFCF; color: #FF0000; }
.shift-cuti { background-color: #e0e0e0; color: #757575; }



/* HOVER EFFECT */
.jadwal-table td:hover {
    background: #fafafa;
    transition: all 0.2s;
    cursor: pointer;
}

/* RESPONSIVE */
@media (max-width: 720px) {
    .jadwal-table th,
    .jadwal-table td {
        padding: 6px 3px;
    }
    
    .sticky-col {
        min-width: 55px;
    }
    
    .date-number {
        font-size: 12px;
    }
    
    .shift-text {
        font-size: 9px;
        padding: 2px 3px;
    }
    
    .jadwal-title-sticky h3 {
        font-size: 15px;
    }
}

/* FIX HEADER TANGGAL */
.jadwal-table thead {
    position: sticky;
    top: 0;
    z-index: 999;
}

.jadwal-table thead tr {
    background: #f8fafc;
}

.jadwal-table thead th {
    position: sticky;
    top: 0;
    background: #f8fafc;
    z-index: 999;
}
        
       