/* enhanced_styles.css - Enhanced CSS untuk Jurnal Mengajar dengan Status Sakit */

/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
}

/* Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem;
    border-radius: 15px;
    margin-bottom: 2rem;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    position: relative;
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

/* Navigation */
.nav {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 2rem;
    justify-content: center;
    padding: 20px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.nav button, .nav a {
    padding: 15px 25px;
    border: none;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.nav button:hover, .nav a:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.nav button.active, .nav a.active {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
    box-shadow: 0 8px 25px rgba(255, 107, 107, 0.4);
}

/* Sections */
.section {
    display: none;
    background: white;
    padding: 2.5rem;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.section.active {
    display: block;
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.section h2 {
    color: #333;
    margin-bottom: 1.5rem;
    font-size: 2rem;
    border-bottom: 3px solid #667eea;
    padding-bottom: 10px;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
    font-size: 14px;
}

.form-group input, 
.form-group select, 
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e1e5e9;
    border-radius: 10px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: white;
}

.form-group input:focus, 
.form-group select:focus, 
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group textarea {
    height: 100px;
    resize: vertical;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-right: 10px;
    margin-bottom: 10px;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.btn-success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(40, 167, 69, 0.4);
}

.btn-danger {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(220, 53, 69, 0.3);
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(220, 53, 69, 0.4);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 12px;
}

/* Filter Container */
.filter-container {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 25px;
    border-radius: 15px;
    margin-bottom: 30px;
    border: 2px solid #dee2e6;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.filter-container h4 {
    color: #495057;
    margin-bottom: 20px;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.filter-row {
    display: flex;
    gap: 20px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.filter-group {
    flex: 1;
    min-width: 150px;
}

.filter-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    font-size: 12px;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-group input, .filter-group select {
    padding: 10px;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    width: 100%;
    font-size: 13px;
    transition: all 0.3s ease;
}

.filter-group input:focus, .filter-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1);
}

/* Digital Signature Styles */
.signature-container {
    border: 2px dashed #ddd;
    border-radius: 15px;
    padding: 25px;
    text-align: center;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    transition: all 0.3s ease;
}

.signature-container:hover {
    border-color: #667eea;
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
}

.signature-pad {
    border: 2px solid #ccc;
    border-radius: 10px;
    cursor: crosshair;
    display: block;
    margin: 15px auto;
    background: white;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.signature-pad:hover {
    border-color: #667eea;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.1), 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.signature-buttons {
    margin-top: 15px;
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

#signature-status {
    margin-top: 15px;
    font-size: 14px;
    font-weight: 500;
    padding: 10px;
    border-radius: 8px;
    background: rgba(255,255,255,0.7);
    border: 1px solid #e0e0e0;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 25px;
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
}

th, td {
    padding: 15px 12px;
    text-align: left;
    border-bottom: 1px solid #e9ecef;
}

th {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    font-weight: 600;
    color: #495057;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.5px;
    position: sticky;
    top: 0;
    z-index: 10;
}

tr:hover {
    background-color: #f8f9fa;
    transition: background-color 0.2s ease;
}

tr:last-child td {
    border-bottom: none;
}

/* Table responsive wrapper */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
}

/* Alert Messages */
.alert {
    padding: 20px;
    margin-bottom: 25px;
    border: none;
    border-radius: 10px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-success {
    color: #155724;
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border-left: 5px solid #28a745;
}

.alert-danger {
    color: #721c24;
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    border-left: 5px solid #dc3545;
}

.alert::before {
    content: "ℹ️";
    font-size: 1.2em;
}

.alert-success::before {
    content: "✅";
}

.alert-danger::before {
    content: "❌";
}

/* Layout */
.row {
    display: flex;
    flex-wrap: wrap;
    gap: 25px;
    margin-bottom: 2rem;
}

.col {
    flex: 1;
    min-width: 300px;
}

/* Signature Modal */
#signatureModal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    z-index: 1000;
    display: none;
    justify-content: center;
    align-items: center;
    animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

#signatureModal .modal-content {
    background: white;
    padding: 30px;
    border-radius: 15px;
    max-width: 600px;
    max-height: 80vh;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: modalSlideIn 0.3s ease;
    overflow: auto;
}

@keyframes modalSlideIn {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

#signatureModal h3 {
    margin-bottom: 20px;
    color: #333;
    font-size: 1.5rem;
}

#signatureModal img {
    max-width: 100%;
    height: auto;
    border: 2px solid #ddd;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Status Indicators - Updated dengan status Sakit */
.status-hadir { 
    background-color: #d4edda; 
    color: #155724;
    padding: 3px 8px;
    border-radius: 5px;
    font-weight: bold;
}

.status-izin { 
    background-color: #fff3cd; 
    color: #856404;
    padding: 3px 8px;
    border-radius: 5px;
    font-weight: bold;
}

.status-sakit { 
    background-color: #d1ecf1; 
    color: #0c5460;
    padding: 3px 8px;
    border-radius: 5px;
    font-weight: bold;
}

.status-alpha { 
    background-color: #f8d7da; 
    color: #721c24;
    padding: 3px 8px;
    border-radius: 5px;
    font-weight: bold;
}

/* Absensi Grid */
.absensi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.absensi-item {
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    background: white;
    transition: all 0.3s ease;
}

.absensi-item:hover {
    border-color: #667eea;
    box-shadow: 0 3px 10px rgba(102, 126, 234, 0.1);
}

.absensi-item strong {
    display: block;
    margin-bottom: 10px;
    color: #333;
    font-size: 16px;
}

.absensi-item label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-right: 12px;
    margin-bottom: 8px;
    cursor: pointer;
    font-weight: normal;
    transition: color 0.2s ease;
    padding: 5px 8px;
    border-radius: 5px;
    font-size: 14px;
}

.absensi-item label:hover {
    background-color: #f8f9fa;
}

/* Status colors untuk radio buttons */
.absensi-item label:has(input[value="hadir"]) {
    border-left: 3px solid #28a745;
}

.absensi-item label:has(input[value="izin"]) {
    border-left: 3px solid #ffc107;
}

.absensi-item label:has(input[value="sakit"]) {
    border-left: 3px solid #17a2b8;
}

.absensi-item label:has(input[value="alpha"]) {
    border-left: 3px solid #dc3545;
}

.absensi-item input[type="radio"] {
    width: auto;
    margin: 0;
    cursor: pointer;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #5a6fd8 0%, #6c5ce7 100%);
}

/* Stats Summary - Updated untuk Support Sakit */
.stats-summary {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 20px;
    border-radius: 15px;
    margin: 20px 0;
    border: 2px solid #dee2e6;
}

.stats-summary h4 {
    color: #495057;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.stats-row {
    display: flex;
    gap: 15px;
    justify-content: space-around;
    flex-wrap: wrap;
}

.stat-item {
    text-align: center;
    padding: 15px 10px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    min-width: 80px;
    flex: 1;
    transition: transform 0.2s ease;
}

.stat-item:hover {
    transform: translateY(-2px);
}

.stat-number {
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 0.9rem;
    color: #666;
    font-weight: 500;
}

/* Colors untuk stat items berdasarkan status */
.stat-item:nth-child(1) .stat-number { color: #28a745; }
.stat-item:nth-child(2) .stat-number { color: #ffc107; }
.stat-item:nth-child(3) .stat-number { color: #17a2b8; }
.stat-item:nth-child(4) .stat-number { color: #dc3545; }

/* Absensi Controls */
.absensi-controls {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.absensi-controls .btn {
    margin: 0;
    font-size: 12px;
    padding: 8px 12px;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .container {
        max-width: 100%;
        padding: 15px;
    }
    
    .absensi-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
}

@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .header {
        padding: 1.5rem;
    }
    
    .header h1 {
        font-size: 1.8rem;
    }
    
    .nav {
        flex-direction: column;
        gap: 10px;
        padding: 15px;
    }
    
    .nav button, .nav a {
        width: 100%;
        justify-content: center;
        padding: 12px 20px;
    }
    
    .filter-row {
        flex-direction: column;
        gap: 15px;
    }
    
    .filter-group {
        min-width: 100%;
    }
    
    .row {
        flex-direction: column;
        gap: 20px;
    }
    
    .section {
        padding: 1.5rem;
    }
    
    .section h2 {
        font-size: 1.5rem;
    }
    
    .signature-pad {
        width: 100%;
        max-width: 350px;
        height: 150px;
    }
    
    .signature-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .stats-row {
        flex-direction: column;
        gap: 10px;
    }
    
    .absensi-grid {
        grid-template-columns: 1fr;
    }
    
    .absensi-item label {
        display: flex;
        margin-right: 0;
        margin-bottom: 5px;
        padding: 8px;
        width: 100%;
        justify-content: flex-start;
    }
    
    table {
        font-size: 12px;
    }
    
    th, td {
        padding: 8px 6px;
    }
    
    #signatureModal .modal-content {
        margin: 20px;
        padding: 20px;
        max-width: calc(100% - 40px);
    }
    
    .absensi-controls {
        flex-direction: column;
        width: 100%;
    }
    
    .absensi-controls .btn {
        width: 100%;
        margin-bottom: 5px;
    }
}

@media (max-width: 480px) {
    .btn {
        width: 100%;
        justify-content: center;
        margin-right: 0;
    }
    
    .filter-container {
        padding: 15px;
    }
    
    .signature-container {
        padding: 15px;
    }
    
    .signature-pad {
        height: 120px;
    }
    
    .stat-item {
        min-width: 60px;
        padding: 10px 5px;
    }
    
    .stat-number {
        font-size: 1.5rem;
    }
}

/* Print Styles */
@media print {
    .nav, .filter-container, .signature-buttons, .absensi-controls {
        display: none;
    }
    
    .section {
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    table {
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .btn {
        display: none;
    }
    
    .absensi-item label {
        break-inside: avoid;
    }
}

/* Accessibility Improvements */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus Styles for Accessibility */
button:focus, 
input:focus, 
select:focus, 
textarea:focus,
a:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .nav button, .nav a {
        border: 2px solid currentColor;
    }
    
    .btn {
        border: 2px solid currentColor;
    }
    
    table {
        border: 2px solid currentColor;
    }
    
    th, td {
        border-bottom: 1px solid currentColor;
    }
    
    .status-hadir, .status-izin, .status-sakit, .status-alpha {
        border: 1px solid currentColor;
    }
}

/* Additional styling untuk SweetAlert2 integration */
.swal2-popup {
    border-radius: 15px !important;
}

.swal2-title {
    font-size: 1.5rem !important;
}

.swal2-content {
    font-size: 1rem !important;
}

/* Enhanced table styling untuk status */
table td.status-cell {
    text-align: center;
    padding: 8px 4px;
}

table td.status-cell .status-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: bold;
    font-size: 11px;
    min-width: 20px;
}

/* Tooltip styles untuk status */
.status-tooltip {
    position: relative;
    cursor: help;
}

.status-tooltip:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 1000;
}