* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background-color: #f5f5f5;
    padding: 10px;
    line-height: 1.6;
    overflow-x: auto;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background-color: white;
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    overflow-x: auto;
}

h1 {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.8em;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Wrapper untuk scroll horizontal */
.table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 20px 0;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.schedule-table {
    width: 100%;
    min-width: 700px; /* Minimum width untuk memastikan semua kolom terlihat */
    border-collapse: collapse;
    font-size: 12px;
    border-radius: 8px;
    overflow: hidden;
}

.schedule-table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.schedule-table th {
    padding: 12px 8px;
    text-align: center;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 11px;
    white-space: nowrap;
    min-width: 80px; /* Minimum width untuk setiap kolom */
}

.schedule-table td {
    padding: 10px 8px;
    text-align: center;
    border-bottom: 1px solid #e0e0e0;
    transition: background-color 0.3s ease;
    white-space: nowrap;
    min-width: 80px;
}

.schedule-table tbody tr:nth-child(even) {
    background-color: #f8f9fa;
}

.schedule-table tbody tr:hover {
    background-color: #e3f2fd;
}

.break-row {
    background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 100%) !important;
}

.break-cell {
    font-weight: bold;
    color: #d32f2f;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 12px !important;
    font-size: 13px;
}

.schedule-table td:first-child,
.schedule-table th:first-child {
    background-color: #3f51b5;
    color: white;
    font-weight: bold;
    position: sticky;
    left: 0;
    z-index: 2;
}

.schedule-table td:nth-child(2),
.schedule-table th:nth-child(2) {
    background-color: #5c6bc0;
    color: white;
    font-weight: bold;
    position: sticky;
    left: 80px; /* Sesuaikan dengan lebar kolom pertama */
    z-index: 2;
}

/* Khusus untuk iPhone dan perangkat mobile */
@media (max-width: 414px) {
    body {
        padding: 5px;
    }
    
    .container {
        padding: 10px;
        margin: 0;
        border-radius: 5px;
    }
    
    h1 {
        font-size: 1.5em;
        margin-bottom: 15px;
        letter-spacing: 0.5px;
    }
    
    .table-wrapper {
        margin: 15px -10px; /* Extend ke tepi container */
        border-radius: 0;
    }
    
    .schedule-table {
        min-width: 600px; /* Reduced minimum width */
        font-size: 11px;
    }
    
    .schedule-table th {
        padding: 10px 6px;
        font-size: 10px;
        min-width: 70px;
    }
    
    .schedule-table td {
        padding: 8px 6px;
        min-width: 70px;
    }
    
    .break-cell {
        font-size: 12px;
        padding: 10px !important;
        letter-spacing: 0.5px;
    }
    
    .schedule-table td:nth-child(2) {
        left: 70px; /* Adjust for smaller column width */
    }
}

/* Khusus untuk iPhone 11 (414px width) */
@media (max-width: 414px) and (-webkit-device-pixel-ratio: 3) {
    .table-wrapper {
        margin: 15px -15px;
        padding: 0 5px;
    }
    
    .schedule-table {
        min-width: 580px;
    }
    
    .schedule-table th,
    .schedule-table td {
        min-width: 65px;
        padding: 8px 4px;
    }
    
    .schedule-table td:nth-child(2) {
        left: 65px;
    }
}

/* Scroll indicator untuk mobile */
@media (max-width: 768px) {
    .table-wrapper::after {
        content: "← Geser untuk melihat semua kolom →";
        display: block;
        text-align: center;
        font-size: 10px;
        color: #666;
        padding: 5px;
        background-color: #f0f0f0;
        border-top: 1px solid #ddd;
    }
}

/* Print Styles */
@media print {
    body {
        background-color: white;
        padding: 0;
    }
    
    .container {
        box-shadow: none;
        padding: 20px;
    }
    
    .table-wrapper {
        overflow: visible;
    }
    
    .schedule-table {
        min-width: auto;
        font-size: 10px;
    }
    
    .schedule-table tbody tr:hover {
        background-color: transparent;
    }
}
