/* Custom Styles for Absensi System */

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Custom animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: .5; }
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.animate-fade-in {
    animation: fadeIn 0.3s ease-out;
}

.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.animate-spin {
    animation: spin 1s linear infinite;
}

/* Card hover effect */
.card-hover {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card-hover:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
}

/* Button styles */
.btn-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    transition: all 0.2s ease;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    transform: translateY(-1px);
}

.btn-success {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    transition: all 0.2s ease;
}

.btn-success:hover {
    background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
    transform: translateY(-1px);
}

/* Status badges */
.badge-success {
    background-color: #dcfce7;
    color: #166534;
}

.badge-warning {
    background-color: #fef9c3;
    color: #854d0e;
}

.badge-danger {
    background-color: #fee2e2;
    color: #991b1b;
}

.badge-info {
    background-color: #dbeafe;
    color: #1e40af;
}

/* Table styles */
.table-hover tbody tr:hover {
    background-color: #f9fafb;
}

/* Input focus styles */
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Loading overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

/* Mobile bottom navigation spacing */
@media (max-width: 768px) {
    main {
        padding-bottom: 80px !important;
    }
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Toast notification */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 16px 24px;
    border-radius: 8px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.2);
    z-index: 10000;
    animation: fadeIn 0.3s ease-out;
}

.toast-success {
    background-color: #22c55e;
    color: white;
}

.toast-error {
    background-color: #ef4444;
    color: white;
}

/* Location status indicator */
.location-valid {
    background-color: #dcfce7;
    border: 1px solid #86efac;
    color: #166534;
}

.location-invalid {
    background-color: #fee2e2;
    border: 1px solid #fca5a5;
    color: #991b1b;
}

.location-loading {
    background-color: #f3f4f6;
    border: 1px solid #d1d5db;
    color: #6b7280;
}

/* Print styles */
@media print {
    nav, aside, .no-print {
        display: none !important;
    }
    
    main {
        padding: 0 !important;
    }
    
    .bg-white {
        box-shadow: none !important;
    }
}

/* Modern Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-container {
    background: white;
    border-radius: 20px;
    padding: 32px;
    max-width: 400px;
    width: 90%;
    transform: scale(0.8) translateY(20px);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.modal-overlay.active .modal-container {
    transform: scale(1) translateY(0);
}

.modal-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.modal-icon.success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.modal-icon.warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.modal-icon.danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.modal-icon.info {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

.modal-icon svg {
    width: 40px;
    height: 40px;
    color: white;
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1f2937;
    text-align: center;
    margin-bottom: 12px;
}

.modal-message {
    color: #6b7280;
    text-align: center;
    margin-bottom: 24px;
    line-height: 1.6;
}

.modal-buttons {
    display: flex;
    gap: 12px;
}

.modal-btn {
    flex: 1;
    padding: 14px 24px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.modal-btn:hover {
    transform: translateY(-2px);
}

.modal-btn:active {
    transform: translateY(0);
}

.modal-btn-cancel {
    background: #f3f4f6;
    color: #4b5563;
}

.modal-btn-cancel:hover {
    background: #e5e7eb;
}

.modal-btn-confirm {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    box-shadow: 0 4px 14px rgba(59, 130, 246, 0.4);
}

.modal-btn-confirm:hover {
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.5);
}

.modal-btn-confirm.success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.4);
}

.modal-btn-confirm.success:hover {
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.5);
}

.modal-btn-confirm.danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    box-shadow: 0 4px 14px rgba(239, 68, 68, 0.4);
}

.modal-btn-confirm.danger:hover {
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.5);
}

/* Alert Modal (single button) */
.modal-buttons.single {
    justify-content: center;
}

.modal-buttons.single .modal-btn {
    flex: 0 1 auto;
    min-width: 120px;
}

/* Camera Modal Specific Styles */
#camera-modal .modal-container {
    padding: 20px;
}

#camera-preview, #photo-preview {
    background: #000;
}

/* Flash effect when taking photo */
@keyframes flash {
    0% { opacity: 0; }
    50% { opacity: 1; }
    100% { opacity: 0; }
}

.camera-flash {
    position: absolute;
    inset: 0;
    background: white;
    animation: flash 0.3s ease-out;
}

/* Photo modal */
#photo-modal .modal-container {
    background: #1f2937;
}

#photo-modal img {
    max-height: 70vh;
    object-fit: contain;
}

#photo-modal .modal-btn-cancel {
    background: rgba(255,255,255,0.1);
    color: white;
}

#photo-modal .modal-btn-cancel:hover {
    background: rgba(255,255,255,0.2);
}
