/**
 * Custom CSS for Document Registry System
 * โรงเรียนบ้านหนองคันนา
 */

/* Responsive Table */
@media (max-width: 768px) {
    .overflow-x-auto {
        -webkit-overflow-scrolling: touch;
    }
    
    table {
        font-size: 0.875rem;
    }
    
    th, td {
        padding: 0.5rem !important;
        white-space: nowrap;
    }
}

/* Loading Overlay Custom */
.loadingoverlay {
    background: rgba(102, 126, 234, 0.8) !important;
}

.loadingoverlay_element {
    border-color: #ffffff !important;
}

/* SweetAlert2 Custom */
.swal2-popup {
    font-family: 'Kanit', sans-serif !important;
}

.swal2-input,
.swal2-textarea {
    font-family: 'Kanit', sans-serif !important;
    border: 1px solid #d1d5db !important;
    border-radius: 0.5rem !important;
}

.swal2-input:focus,
.swal2-textarea:focus {
    border-color: #667eea !important;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1) !important;
}

/* Smooth Scroll */
html {
    scroll-behavior: smooth;
}

/* Print Styles */
@media print {
    header,
    nav,
    footer,
    .tab-button,
    button {
        display: none !important;
    }
    
    .tab-content {
        display: block !important;
    }
    
    table {
        page-break-inside: avoid;
    }
}

/* Animation */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.stat-card {
    animation: slideIn 0.5s ease-out;
}

/* 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, #5568d3 0%, #653a8b 100%);
}

/* Mobile Navigation */
@media (max-width: 640px) {
    nav .flex {
        scrollbar-width: thin;
        scrollbar-color: #667eea #f1f1f1;
    }
}

/* Gradient Text */
.gradient-text {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Button Hover Effect */
button:not(.tab-button) {
    transition: all 0.3s ease;
}

button:not(.tab-button):hover {
    transform: translateY(-2px);
}

/* Card Shadow */
.shadow-card {
    box-shadow: 0 4px 6px -1px rgba(102, 126, 234, 0.1), 
                0 2px 4px -1px rgba(102, 126, 234, 0.06);
}

/* Responsive Font Size */
@media (max-width: 640px) {
    h1 {
        font-size: 1.25rem !important;
    }
    
    h2 {
        font-size: 1.125rem !important;
    }
    
    .stat-card h3 {
        font-size: 1.875rem !important;
    }
}

/* Loading Animation */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-spinner {
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}
