/**
 * Custom CSS
 * สไตล์เพิ่มเติมสำหรับระบบ
 */

/* Thai Font */
body {
    font-family: 'Sarabun', 'Prompt', sans-serif;
}

/* Color Variables */
.bg-primary-custom {
    background-color: var(--primary-color) !important;
}

.text-primary-custom {
    color: var(--primary-color) !important;
}

/* Card Enhancements */
.card {
    box-shadow: 0 0 1px rgba(0,0,0,.125), 0 1px 3px rgba(0,0,0,.2);
    transition: transform 0.2s;
}

.card:hover {
    transform: translateY(-2px);
}

.small-box {
    border-radius: 10px;
}

.small-box .icon {
    transition: transform 0.3s;
}

.small-box:hover .icon {
    transform: scale(1.1);
}

/* Progress Bar */
.progress {
    height: 25px;
    font-size: 14px;
    border-radius: 8px;
}

/* DataTables */
.dataTables_wrapper .dataTables_filter input {
    border-radius: 20px;
    padding: 5px 15px;
}

.dataTables_wrapper .dataTables_length select {
    border-radius: 5px;
}

/* Loading Spinner */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.spinner-border-custom {
    width: 3rem;
    height: 3rem;
}

/* Alert Animations */
.alert {
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Chart Container */
.chart-container {
    position: relative;
    height: 300px;
    margin-bottom: 20px;
}

/* File Upload */
.custom-file-upload {
    border: 2px dashed #ccc;
    border-radius: 10px;
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.custom-file-upload:hover {
    border-color: var(--primary-color);
    background-color: #f8f9fa;
}

.custom-file-upload i {
    font-size: 48px;
    color: #ccc;
    margin-bottom: 10px;
}

/* Responsive */
@media (max-width: 768px) {
    .content-wrapper {
        padding: 15px;
    }

    .small-box .icon {
        font-size: 60px;
    }
}

/* Sidebar Scrollable */
.main-sidebar {
    overflow: hidden;
}

.main-sidebar .sidebar {
    overflow-y: auto;
    overflow-x: hidden;
    height: calc(100vh - 57px); /* หักความสูงของ brand-link */
}

/* Custom Scrollbar for Sidebar */
.main-sidebar .sidebar::-webkit-scrollbar {
    width: 6px;
}

.main-sidebar .sidebar::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

.main-sidebar .sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.main-sidebar .sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* For Firefox */
.main-sidebar .sidebar {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) rgba(255, 255, 255, 0.05);
}

/* Print Styles */
@media print {
    .main-sidebar,
    .main-header,
    .content-header,
    .main-footer,
    .no-print {
        display: none !important;
    }

    .content-wrapper {
        margin: 0 !important;
        padding: 0 !important;
    }
}
