/* Reset dan Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    background-color: #f8f9fa;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
header {
    background-color: #fff;
    padding: 20px 0;
    border-bottom: 1px solid #dee2e6;
    margin-bottom: 30px;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-content h1 {
    font-size: 1.8em;
    color: #333;
}

/* Footer */
footer {
    text-align: center;
    padding: 20px 0;
    margin-top: 40px;
    background-color: #fff;
    border-top: 1px solid #dee2e6;
    color: #6c757d;
}

/* Main Content */
main {
    padding-bottom: 50px;
}

/* Card */
.card {
    background-color: #fff;
    border: 1px solid #e1e4e8;
    border-radius: 6px;
    margin-bottom: 20px;
}

.card-header {
    padding: 16px;
    background-color: #f6f8fa;
    border-bottom: 1px solid #e1e4e8;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h2 {
    margin: 0;
    font-size: 1.4em;
}

.card-body {
    padding: 16px;
}

/* Table */
.table-responsive {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 12px 15px;
    border: 1px solid #ddd;
    text-align: left;
    white-space: nowrap;
}

td[data-label="Catatan Dosen"] {
    white-space: pre-wrap;
}

thead {
    background-color: #f4f4f4;
}

tbody tr:nth-child(even) {
    background-color: #f9f9f9;
}

/* Buttons */
.button, button {
    display: inline-block;
    padding: 10px 15px;
    border: none;
    border-radius: 5px;
    font-size: 1em;
    text-decoration: none;
    color: #fff;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.1s;
    text-align: center;
}

.button:active, button:active {
    transform: translateY(1px);
}

.button-primary { background-color: #007bff; }
.button-primary:hover { background-color: #0056b3; }

.button-success { background-color: #218838; }
.button-success:hover { background-color: #1e7e34; }

.button-danger { background-color: #dc3545; }
.button-danger:hover { background-color: #c82333; }

.button-secondary { background-color: #6c757d; color: #fff; }
.button-secondary:hover { background-color: #5a6268; }

/* Status Badges */
.status-badge {
    padding: 5px 10px;
    border-radius: 15px;
    color: #fff;
    font-size: 0.9em;
    text-transform: capitalize;
}

.status-menunggu { background-color: #ffc107; color: #333; }
.status-selesai { background-color: #28a745; }
.status-berlangsung { background-color: #17a2b8; }
.status-dibatalkan { background-color: #dc3545; }

/* Alerts / Notifications */
.alert {
    padding: 15px;
    margin-bottom: 20px;
    border: 1px solid transparent;
    border-radius: 4px;
    width: 100%;
    position: relative;
}

.alert-success {
    color: #155724;
    background-color: #d4edda;
    border-color: #c3e6cb;
}

.alert-danger {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
}

.alert .close-alert {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 20px;
    font-weight: bold;
    color: inherit;
    cursor: pointer;
    transition: opacity 0.2s;
}

.alert .close-alert:hover {
    opacity: 0.7;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s;
}

.modal-content {
    background-color: #fefefe;
    margin: 10% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 500px;
    border-radius: 8px;
    position: relative;
}

.close-button {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
}

.close-button:hover,
.close-button:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

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

/* Form Groups */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

/* Slot Waktu Buttons */
#slot-waktu-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.slot-button {
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    text-align: center;
    cursor: pointer;
    transition: background-color 0.3s, color 0.3s, border-color 0.3s;
    background-color: #fff;
    color: #333;
}

.slot-button.available:hover {
    background-color: #e9ecef;
    border-color: #adb5bd;
}

.slot-button.selected {
    background-color: #007bff;
    color: white;
    border-color: #007bff;
}

.slot-button.booked {
    background-color: #f8d7da;
    color: #721c24;
    border-color: #f5c6cb;
    cursor: not-allowed;
    text-decoration: line-through;
}

/* Responsive Design */
@media screen and (max-width: 768px) {
    .header-content {
        flex-direction: column;
        align-items: flex-start;
    }

    .header-content h1 {
        margin-bottom: 10px;
    }
    
    .header-content nav {
        display: flex;
        flex-direction: column;
        width: 100%;
    }

    .header-content nav a {
        margin-bottom: 10px;
    }

    .card-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .card-header h2 {
        margin-bottom: 15px;
    }

    .modal-content {
        width: 95%;
        margin: 20% auto;
    }
}

/* Slot Waktu */
#slot-waktu-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.slot-waktu {
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    text-align: center;
    cursor: pointer;
    transition: background-color 0.3s, color 0.3s;
}

.slot-waktu.selected {
    background-color: #007bff;
    color: white;
    border-color: #007bff;
}

.slot-waktu.disabled {
    background-color: #e9ecef;
    color: #6c757d;
    cursor: not-allowed;
    text-decoration: line-through;
}

/* Responsive Design */
@media screen and (max-width: 768px) {
    .header-content {
        flex-direction: column;
        align-items: flex-start;
    }

    .header-content h1 {
        margin-bottom: 10px;
    }

    .card-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .card-header h2 {
        margin-bottom: 15px;
    }

    .modal-content {
        width: 95%;
        margin: 20% auto;
    }
}

.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background-color: var(--white-color);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    display: flex;
    align-items: center;
    gap: 1.5rem;
    transition: transform 0.3s, box-shadow 0.3s;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.stat-icon {
    font-size: 2rem;
    padding: 1rem;
    border-radius: 50%;
    color: var(--white-color);
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-icon.icon-today { background-color: #17a2b8; }
.stat-icon.icon-waiting { background-color: #ffc107; }
.stat-icon.icon-done { background-color: var(--success-color); }

.stat-info h3 {
    margin: 0;
    font-size: 1rem;
    color: var(--secondary-color);
    font-weight: 500;
}

.stat-info p {
    margin: 0;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--dark-color);
}

.filter-form {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-form label {
    font-weight: 500;
}

.action-form {
    display: flex;
    gap: 0.5rem;
}

.button-sm {
    padding: 0.3rem 0.6rem;
    font-size: 0.8rem;
}

.button-sm .fas {
    font-size: 0.9rem;
}

.page-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.page-header h2 {
    margin: 0;
    color: var(--primary-color);
}

.page-header p {
    margin: 0.25rem 0 0;
    color: var(--secondary-color);
    font-size: 1rem;
}

.header-link {
    color: var(--white-color);
    text-decoration: none;
    font-size: 1.5rem;
    font-weight: 600;
}

.header-nav {
    display: flex;
    gap: 1rem;
}

.nav-link {
    color: var(--white-color);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    transition: background-color 0.3s;
}

.nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
}