/* Reset CSS untuk mencegah Quirks Mode */
* {
    box-sizing: border-box;
}

html {
    line-height: 1.15;
    -webkit-text-size-adjust: 100%;
}

/* General Body Styling */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #f4f7f6;
    color: #333;
    margin: 0;
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 20px auto;
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

/* Header Styling */
header {
    background: #0056b3; /* Dark Blue */
    color: #fff;
    padding: 20px 0;
    text-align: center;
    border-bottom: 4px solid #004080;
    position: relative; /* Needed for positioning context */
    display: block;
    width: 100%;
}

header h1 {
    margin: 0;
    font-size: 2.5em;
    font-weight: 300;
}

header h2 {
    margin: 0;
    font-size: 1.2em;
    font-weight: 300;
    opacity: 0.9;
}

/* Header Navigation (for Logout button) */
.header-nav {
    position: absolute;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
}

/* Stats Cards Styling (Dashboard) */
.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card {
    background: #ffffff;
    padding: 25px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    border-left: 5px solid #007bff; /* Blue accent */
}

.stat-card:nth-child(2) { border-color: #28a745; } /* Green */
.stat-card:nth-child(3) { border-color: #ffc107; } /* Yellow */
.stat-card:nth-child(4) { border-color: #17a2b8; } /* Teal */

.stat-card h3 {
    margin-top: 0;
    font-size: 1.2em;
    color: #555;
}

.stat-card p {
    font-size: 2.5em;
    font-weight: bold;
    margin-bottom: 0;
    color: #0056b3;
}


/* Table Styling */
.table-container {
    overflow-x: auto;
}

.table-container h2, .form-container h2 {
    text-align: center;
    margin-bottom: 20px;
    color: #333;
    font-weight: 400;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    display: table;
    table-layout: auto;
}

th, td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

thead th {
    background-color: #0066cc;
    color: white;
    font-weight: 500;
}

tbody tr:nth-child(even) {
    background-color: #f9f9f9;
}

tbody tr:hover {
    background-color: #f1f1f1;
}

/* Status Labels Styling */
.status-sedang-berlangsung {
    background-color: #28a745;
    color: white;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 0.9em;
    font-weight: bold;
}
.status-akan-datang {
    background-color: #ffc107;
    color: #333;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 0.9em;
    font-weight: bold;
}
.status-selesai {
    background-color: #6c757d;
    color: white;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 0.9em;
    font-weight: bold;
}

/* Form Styling (Admin) */
.form-container {
    background: #f9f9f9;
    padding: 30px;
    border-radius: 8px;
    margin-bottom: 40px;
    display: block;
    width: 100%;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #555;
    cursor: pointer;
}

.form-group {
    margin-bottom: 15px;
    display: block;
}

.form-control {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box; /* Important */
    display: block;
    font-size: 16px; /* Mencegah zoom di mobile */
}

/* Action Buttons */
.action-buttons {
    margin-bottom: 20px;
    text-align: center;
}

.action-buttons .btn {
    margin: 0 10px;
    padding: 12px 20px;
    font-weight: 500;
    transition: all 0.3s ease;
}

/* Icon Styling */
.icon {
    margin-right: 8px;
    font-size: 1.1em;
}

/* Button Styling */
.btn {
    padding: 10px 15px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    font-size: 1em;
    margin-right: 5px;
    display: inline-block;
    transition: all 0.3s ease;
    font-family: inherit;
    line-height: 1.5;
    text-align: center;
    vertical-align: middle;
    user-select: none;
}
.btn-primary {
    background-color: #007bff;
    color: white;
}
.btn-primary:hover {
    background-color: #0069d9;
}
.btn-secondary {
    background-color: #6c757d;
    color: white;
}
.btn-secondary:hover {
    background-color: #5a6268;
}
.btn-warning {
    background-color: #ffc107;
    color: #212529;
}
.btn-warning:hover {
    background-color: #e0a800;
}
.btn-danger {
    background-color: #dc3545;
    color: white;
}
.btn-danger:hover {
    background-color: #c82333;
}
.btn-info {
    background-color: #17a2b8;
    color: white;
}
.btn-info:hover {
    background-color: #138496;
}

.btn-aksi {
    padding: 8px 12px;
    font-size: 0.85em;
    margin: 2px;
    color: white;
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 60px;
    font-weight: 500;
}

.btn-aksi:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    filter: brightness(1.1);
}

.btn-aksi:active {
    transform: translateY(0);
    box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

/* Loading state untuk tombol */
.btn-aksi.loading {
    opacity: 0.7;
    pointer-events: none;
}

.btn-aksi.loading .icon {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Success Message Styling */
.success-message {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    padding: 15px 20px;
    border-radius: 8px;
    margin: 20px 0;
    text-align: center;
    font-weight: 500;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
    animation: slideDown 0.5s ease;
    position: relative;
}

.success-message::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #fff, transparent, #fff);
    animation: shimmer 2s infinite;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUp {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-20px);
    }
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Error Message Styling */
.error-message {
    background: linear-gradient(135deg, #dc3545, #c82333);
    color: white;
    padding: 15px 20px;
    border-radius: 8px;
    margin: 20px 0;
    text-align: center;
    font-weight: 500;
    box-shadow: 0 4px 15px rgba(220, 53, 69, 0.3);
    animation: slideDown 0.5s ease;
    position: relative;
}

.error-message::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #fff, transparent, #fff);
    animation: shimmer 2s infinite;
}

.edit { 
    background-color: #17a2b8; 
    color: white; 
}

.edit:hover { 
    background-color: #138496; 
}

.hapus { 
    background-color: #dc3545; 
}

.hapus:hover { 
    background-color: #c82333; 
}

.btn-aksi .icon {
    margin-right: 4px;
    font-size: 0.9em;
}

/* Container untuk tombol aksi */
td:last-child {
    text-align: center;
    white-space: nowrap;
    padding: 8px 4px;
    position: relative;
}

/* Tooltip styling */
.btn-aksi[title]:hover::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 1000;
    margin-bottom: 5px;
}

/* Responsive untuk tombol aksi */
@media (max-width: 768px) {
    .btn-aksi {
        padding: 6px 8px;
        font-size: 0.8em;
        min-width: 50px;
    }
    
    .btn-aksi .icon {
        margin-right: 2px;
        font-size: 0.8em;
    }
}

/* Form Actions */
.form-actions {
    text-align: center;
    margin-top: 20px;
}

.form-actions .btn {
    margin: 0 10px;
    padding: 12px 25px;
    font-weight: 500;
}

/* Notification Styling */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 5px;
    color: white;
    font-weight: 500;
    z-index: 1000;
    animation: slideIn 0.3s ease;
}

.notification.success {
    background-color: #28a745;
}

.notification.error {
    background-color: #dc3545;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}


/* Footer Navigation */
.footer-nav {
    text-align: center;
    margin-top: 30px;
}
.footer-nav a {
    color: #007bff;
    text-decoration: none;
    font-weight: bold;
}
.footer-nav a:hover {
    text-decoration: underline;
}

/* Utility Classes */
.loading, .error, .no-data {
    text-align: center;
    padding: 20px;
    font-style: italic;
    color: #666;
}

/* Dashboard Admin Styling */
.dashboard-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.chart-container {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.stats-grid .stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    border-left: none;
}

.stats-grid .stat-card h3 {
    margin: 0 0 10px 0;
    font-size: 14px;
    opacity: 0.9;
    color: white;
}

.stats-grid .stat-card .number {
    font-size: 2em;
    font-weight: bold;
    margin: 0;
    color: white;
}

.recent-activities {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.activity-item {
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-title {
    font-weight: bold;
    color: #333;
}

.activity-details {
    font-size: 0.9em;
    color: #666;
    margin-top: 5px;
}

.nav-tabs {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 2px solid #eee;
}

.nav-tab {
    padding: 10px 20px;
    background: none;
    border: none;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.3s;
}

.nav-tab.active {
    border-bottom-color: #667eea;
    color: #667eea;
    font-weight: bold;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Responsive Design */
@media (max-width: 768px) {
    header h1 {
        font-size: 2em;
    }
    th, td {
        padding: 8px 10px;
    }
    
    .dashboard-container {
        grid-template-columns: 1fr;
    }
    
    .nav-tabs {
        flex-direction: column;
    }
    
    .nav-tab {
        text-align: left;
        border-bottom: 1px solid #eee;
    }
    
    .container {
        margin: 10px;
        padding: 15px;
    }
    
    .form-container {
        padding: 20px;
    }
}

/* Fix untuk IE dan browser lama */
@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {
    .container {
        display: block;
    }
    
    .form-container {
        display: block;
    }
    
    table {
        display: table;
    }
} 