@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap');

/* variabel warna muhammadiyah */
:root {
    --nm-color-primary: #009c48;     /* Hijau Utama */
    --nm-color-dark: #1a1a1a;
    --nm-color-text: #444444;
    --nm-border: #e5e5e5;
    --muh-green: #0e703f;            /* Hijau Muhammadiyah */
    --muh-gold: #cda851;             /* Emas Muhammadiyah */
}

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

body {
    background: linear-gradient(135deg, #1a3a6b 0%, #0e703f 35%, #009c48 65%, #2ecc71 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px;
}

/* card tabel jadwal */
.card {
    width: 100%;
    height: 100%;
    background-color: #FFFFFF;
    border-radius: 20px;
    padding: 16px 10px 10px 10px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 8px 12px 8px;
    flex-shrink: 0;
    flex-wrap: wrap;
    gap: 8px;
    border-bottom: 2px solid #e8e8e8;
    margin-bottom: 8px;
}

.card-title {
    font-size: clamp(13px, 2vw, 20px);
    font-weight: 700;
    color: var(--muh-green);
    line-height: 1.2;
}

.week-selector {
    flex-shrink: 0;
    margin-left: auto;
    margin-right: 10px;
}

.week-dropdown {
    padding: 8px 14px;
    border: 2px solid #d0e6d5;
    border-radius: 10px;
    font-size: clamp(10px, 1.2vw, 13px);
    font-family: inherit;
    font-weight: 500;
    background-color: #f0f7f2;
    color: var(--muh-green);
    cursor: pointer;
    outline: none;
    transition: all 0.2s ease;
    min-width: 160px;
    appearance: none;
    -webkit-appearance: none;
}

.week-dropdown:hover {
    border-color: var(--muh-green);
}

.week-dropdown:focus {
    border-color: var(--muh-green);
    box-shadow: 0 0 0 3px rgba(14, 112, 63, 0.15);
}

.btn-ajukan {
    background-color: #0a5c32;
    color: #FFFFFF;
    padding: 8px 18px;
    border-radius: 25px;
    text-decoration: none;
    font-size: clamp(10px, 1.4vw, 13px);
    font-weight: 600;
    white-space: nowrap;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(10, 92, 50, 0.3);
    flex-shrink: 0;
}

.btn-ajukan:hover {
    background-color: #0e703f;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(10, 92, 50, 0.4);
}

.table-wrapper {
    flex-grow: 1;
    overflow: hidden;
    padding: 0 8px 8px 8px;
}

table {
    width: 100%;
    height: 100%;
    border-collapse: separate;
    border-spacing: 0;
    table-layout: fixed;
    border: 1px solid #d0e6d5;
    border-radius: 12px;
    overflow: hidden;
}

th, td {
    text-align: center;
    vertical-align: middle;
    font-size: clamp(8px, 1.2vw, 13px);
    padding: 4px 2px;
    border-bottom: 1px solid #d0e6d5;
    border-right: 1px solid #d0e6d5;
}

th {
    background: linear-gradient(180deg, #1a3a6b, #0e703f);
    color: #FFFFFF;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    font-size: clamp(7px, 1vw, 11px);
}

th:last-child, td:last-child {
    border-right: none;
}

tr:last-child td {
    border-bottom: none;
}

th:first-child, td:first-child {
    width: 8%;
    background: #f0f7f2;
    font-weight: 600;
    color: var(--muh-green);
}

td {
    background-color: #FFFFFF;
    color: var(--nm-color-text);
    position: relative;
}
/* 
tbody tr:hover td {
    background-color: #f0f7f2;
} */

td:not(:first-child)::after {
    content: "—";
    color: #c0d8c8;
    font-size: 0.9em;
}

.jadwal-card {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #f0f7f2, #d0e6d5);
    border-left: 4px solid #0e703f;
    border-radius: 6px;
    padding: 4px 6px;
    font-size: clamp(7px, 0.9vw, 11px);
    line-height: 1.3;
    overflow: hidden;
    z-index: 5;
    box-shadow: 0 2px 8px rgba(14, 112, 63, 0.1);
    text-align: left;
}

/* navigasi jadwal lab */
.lab-navigation {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    padding: 8px 0 4px 0;
    flex-shrink: 0;
}

.lab-arrow {
    background: linear-gradient(135deg, #0a5c32, #0e703f);
    color: #FFFFFF;
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(10, 92, 50, 0.2);
}

.lab-arrow:hover {
    background: linear-gradient(135deg, #0e703f, #1a8b50);
    transform: scale(1.1);
}

.lab-arrow:active {
    transform: scale(0.95);
}

.lab-title {
    font-size: clamp(14px, 2vw, 18px);
    font-weight: 700;
    color: #0a5c32;
    min-width: 180px;
    text-align: center;
}

/* modal pengajuan */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: fadeIn 0.2s ease;
}

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

.modal-content {
    background-color: #FFFFFF;
    border-radius: 16px;
    padding: 28px 24px;
    width: 90%;
    max-width: 520px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.25s ease;
}

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

.modal-title {
    font-size: 20px;
    font-weight: 700;
    color: #0a5c32;
    margin-bottom: 20px;
    text-align: center;
    position: relative;
    padding-bottom: 12px;
}

.modal-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 3px;
    background: linear-gradient(135deg, #0a5c32, #2ecc71);
    border-radius: 2px;
}

/* Info box */
.info-box {
    background: linear-gradient(135deg, #f0f7f2, #e8f5e9);
    padding: 14px 16px;
    border-radius: 12px;
    margin-bottom: 18px;
    border-left: 4px solid #0a5c32;
}

.info-box p {
    margin: 0;
    font-size: 13px;
    color: #333;
}

.info-box strong {
    color: #0a5c32;
}

/* Form di dalam modal */
.modal-content .form-group {
    margin-bottom: 14px;
}

.modal-content .form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #555;
    margin-bottom: 5px;
}

.modal-content .form-input {
    width: 100%;
    padding: 10px 14px;
    font-size: 14px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    outline: none;
    transition: all 0.2s ease;
    font-family: inherit;
    background-color: #fafafa;
}

.modal-content .form-input:focus {
    border-color: #0a5c32;
    box-shadow: 0 0 0 3px rgba(10, 92, 50, 0.1);
    background-color: #fff;
}

.modal-content select.form-input {
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%230a5c32' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.modal-content .form-row {
    display: flex;
    gap: 12px;
}

.modal-content .form-group-half {
    flex: 1;
}

/* Tombol */
.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

.btn-simpan {
    background: linear-gradient(135deg, #0a5c32, #0e703f);
    color: #FFFFFF;
    border: none;
    border-radius: 10px;
    padding: 10px 24px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(10, 92, 50, 0.3);
}

.btn-simpan:hover {
    background: linear-gradient(135deg, #0e703f, #1a8b50);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(10, 92, 50, 0.4);
}

.btn-batal {
    background-color: #f5f5f5;
    color: #666;
    border: 1px solid #ddd;
    border-radius: 10px;
    padding: 10px 24px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-batal:hover {
    background-color: #e0e0e0;
}

/* Warning text */
.modal-warning {
    font-size: 12px;
    color: #888;
    margin-top: 8px;
    text-align: center;
}

/* Sel kosong */
td:not(:first-child) {
    cursor: pointer;
    transition: background-color 0.15s ease;
}

td:not(:first-child):hover {
    background-color: #e8f5e9;
}

/* Responsive */
@media (max-width: 640px) {
    .modal-content {
        width: 95%;
        padding: 20px 16px;
    }
    .modal-content .form-row {
        flex-direction: column;
        gap: 0;
    }
}

/* Sel kosong bisa diklik */
td:not(:first-child) {
    cursor: pointer;
}
td:not(:first-child):hover {
    background-color: #e8f5e9;
}

@media (max-width: 1024px) {
    body {
        padding: 8px;
    }
    .card {
        border-radius: 16px;
    }
}

@media (max-width: 640px) {
    body {
        padding: 4px;
    }
    .card {
        border-radius: 14px;
        padding: 10px 4px 4px 4px;
    }
    .card-header {
        padding: 0 4px 6px 4px;
    }
    .week-dropdown {
        min-width: 130px;
        font-size: 9px;
        padding: 6px 10px;
    }
    table {
        border-radius: 8px;
    }
    th, td {
        font-size: 7px;
        padding: 2px 1px;
    }
    th {
        font-size: 6px;
    }
    th:first-child, td:first-child {
        width: 6%;
    }
}

@media (max-width: 400px) {
    .card-title {
        font-size: 10px;
    }
    .btn-ajukan {
        font-size: 8px;
        padding: 4px 10px;
    }
    th, td {
        font-size: 6px;
    }
}