/**
 * Custom Stylesheet
 * ระบบบริหารจัดการเงินนอกงบประมาณ
 */

/* ========================================
   Global Styles
   ======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Sarabun', sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

/* ========================================
   Navigation & Sidebar
   ======================================== */
.navbar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
}

.sidebar {
    width: 260px;
    min-height: calc(100vh - 56px);
    position: sticky;
    top: 56px;
    transition: all 0.3s ease;
    overflow-y: auto;
}

.sidebar.collapsed {
    width: 0;
    overflow: hidden;
}

.sidebar-header {
    background-color: rgba(0, 0, 0, 0.2);
}

.sidebar-nav .nav-link {
    padding: 12px 15px;
    border-radius: 8px;
    margin-bottom: 5px;
    transition: all 0.3s ease;
}

.sidebar-nav .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    transform: translateX(5px);
}

.sidebar-nav .nav-link.active {
    background-color: rgba(255, 255, 255, 0.2);
    font-weight: 600;
}

#mainContent {
    transition: all 0.3s ease;
    min-height: calc(100vh - 56px);
}

#mainContent.expanded {
    margin-left: 0;
}

/* ========================================
   Cards & Containers
   ======================================== */
.card {
    border: none;
    border-radius: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
}

.card-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 15px 15px 0 0 !important;
    padding: 15px 20px;
    font-weight: 600;
}

.card-body {
    padding: 20px;
}

/* ========================================
   Stats Cards
   ======================================== */
.stat-card {
    border-left: 4px solid;
    transition: all 0.3s ease;
}

.stat-card.stat-primary {
    border-left-color: #667eea;
}

.stat-card.stat-success {
    border-left-color: #28a745;
}

.stat-card.stat-warning {
    border-left-color: #ffc107;
}

.stat-card.stat-danger {
    border-left-color: #dc3545;
}

.stat-card.stat-info {
    border-left-color: #17a2b8;
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
}

.stat-icon.bg-primary-light {
    background-color: rgba(102, 126, 234, 0.1);
    color: #667eea;
}

.stat-icon.bg-success-light {
    background-color: rgba(40, 167, 69, 0.1);
    color: #28a745;
}

.stat-icon.bg-warning-light {
    background-color: rgba(255, 193, 7, 0.1);
    color: #ffc107;
}

.stat-icon.bg-danger-light {
    background-color: rgba(220, 53, 69, 0.1);
    color: #dc3545;
}

.stat-icon.bg-info-light {
    background-color: rgba(23, 162, 184, 0.1);
    color: #17a2b8;
}

/* ========================================
   Buttons
   ======================================== */
.btn {
    border-radius: 8px;
    padding: 10px 20px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #5568d3 0%, #6a3f8f 100%);
}

/* ========================================
   Forms
   ======================================== */
.form-control, .form-select {
    border-radius: 8px;
    border: 2px solid #e0e0e0;
    padding: 10px 15px;
    transition: all 0.3s ease;
}

.form-control:focus, .form-select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

.form-label {
    font-weight: 600;
    margin-bottom: 8px;
    color: #555;
}

/* ========================================
   Tables
   ======================================== */
.table {
    border-radius: 10px;
    overflow: hidden;
}

.table thead th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: 600;
    border: none;
    padding: 15px;
}

.table tbody tr {
    transition: background-color 0.2s ease;
}

.table tbody tr:hover {
    background-color: rgba(102, 126, 234, 0.05);
}

.table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(0, 0, 0, 0.02);
}

/* ========================================
   Badges
   ======================================== */
.badge {
    padding: 6px 12px;
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.85rem;
}

/* ========================================
   DataTables Customization
   ======================================== */
.dataTables_wrapper .dataTables_length select,
.dataTables_wrapper .dataTables_filter input {
    border-radius: 6px;
    border: 2px solid #e0e0e0;
    padding: 5px 10px;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    border-color: #667eea !important;
    color: white !important;
}

/* ========================================
   Utilities
   ======================================== */
.text-currency {
    font-family: 'Courier New', monospace;
    font-weight: 600;
}

.page-header {
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 3px solid #667eea;
}

.page-header h1 {
    font-size: 2rem;
    font-weight: 700;
    color: #333;
}

.breadcrumb {
    background-color: transparent;
    padding: 0;
    margin-bottom: 20px;
}

.breadcrumb-item.active {
    color: #667eea;
}

/* ========================================
   Animations
   ======================================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease;
}

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        z-index: 1000;
        left: -260px;
    }
    
    .sidebar.show {
        left: 0;
    }
    
    #mainContent {
        margin-left: 0 !important;
    }
    
    .stat-card {
        margin-bottom: 15px;
    }
}

/* ========================================
   Print Styles
   ======================================== */
@media print {
    .navbar, .sidebar, .btn, .no-print {
        display: none !important;
    }
    
    #mainContent {
        margin-left: 0 !important;
        padding: 0 !important;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    body {
        background-color: white;
    }
}
