/* assets/css/style.css */
/* Additional styles can go here */

.map-marker-label {
    background: white;
    border: 1px solid #333;
    padding: 2px 5px;
    border-radius: 3px;
    font-size: 10px;
    white-space: nowrap;
}

/* =========================================
   SweetAlert2 Dark/Premium Theme Overrides
   ========================================= */
body .swal2-popup {
    background-color: #1e293b !important; /* Slate 800 */
    color: #f1f5f9 !important; /* Slate 100 */
    border: 1px solid #334155;
    border-radius: 20px !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5) !important;
}

body .swal2-title {
    color: #fff !important;
    font-size: 1.6em !important;
    font-weight: 600 !important;
}

body .swal2-html-container {
    color: #cbd5e1 !important; /* Slate 300 */
}

body .swal2-close {
    color: #cbd5e1 !important;
}

body .swal2-close:hover {
    color: #fff !important;
}

/* Form Inputs inside SweetAlert */
body .swal2-popup .swal-label,
body .swal2-popup label {
    color: #94a3b8 !important; /* Slate 400 */
    font-weight: 500 !important;
}

body .swal2-popup .custom-input,
body .swal2-popup .custom-select,
body .swal2-popup input:not([type="checkbox"]):not([type="radio"]),
body .swal2-popup select {
    background-color: #0f172a !important; /* Slate 900 */
    border: 1px solid #334155 !important; /* Slate 700 */
    color: #f8fafc !important; /* Slate 50 */
    border-radius: 10px !important;
    box-shadow: none !important;
}

body .swal2-popup .custom-input:focus,
body .swal2-popup .custom-select:focus,
body .swal2-popup input:not([type="checkbox"]):not([type="radio"]):focus,
body .swal2-popup select:focus {
    border-color: #3b82f6 !important; /* Blue 500 */
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2) !important;
}

/* Select2 Dark Mode Fixes within SweetAlert */
body .swal2-popup .select2-container .select2-selection--single {
    background-color: #0f172a !important;
    border-color: #334155 !important;
    height: 48px !important;
    border-radius: 10px !important;
}

body .swal2-popup .select2-container .select2-selection--single .select2-selection__rendered {
    color: #f8fafc !important;
    line-height: 46px !important;
}

body .swal2-popup .select2-container--default .select2-selection--single .select2-selection__arrow b {
    border-color: #94a3b8 transparent transparent transparent !important;
    top: 50%;
}

body .select2-dropdown {
    background-color: #1e293b !important;
    border-color: #334155 !important;
    color: #f1f5f9 !important;
}

body .select2-results__option {
    color: #f1f5f9 !important;
    background-color: #1e293b !important; /* บังคับพื้นหลังปกติเป็นสีเข้ม */
}

/* แก้ไขปัญหา background สีขาวเวลาเลือกหรือ hover ทำให้มองไม่เห็นตัวหนังสือ */
body .select2-results__option[aria-selected="true"] {
    background-color: #334155 !important; /* สีเทาเข้มตอนถูกเลือกแล้ว */
    color: #ffffff !important;
}

body .select2-results__option--highlighted[aria-selected] {
    background-color: #3b82f6 !important; /* สีฟ้าตอนเอาเมาส์ชี้ */
    color: #ffffff !important;
}

body .select2-search__field {
    background-color: #0f172a !important;
    border: 1px solid #334155 !important;
    color: white !important;
}

/* Select2 global light-mode fix for user/report pages */
body:not(.dark-mode) .select2-container--default .select2-selection--single {
    background-color: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 8px !important;
    color: #0f172a !important;
}

body:not(.dark-mode) .select2-container--default .select2-selection--single .select2-selection__rendered {
    color: #0f172a !important;
    -webkit-text-fill-color: #0f172a !important;
    padding-left: 14px !important;
    padding-right: 34px !important;
}

body:not(.dark-mode) .select2-container--default .select2-selection--single .select2-selection__placeholder {
    color: #64748b !important;
    -webkit-text-fill-color: #64748b !important;
}

body:not(.dark-mode) .select2-container--default .select2-selection--single .select2-selection__clear {
    display: none !important;
}

body:not(.dark-mode) .select2-dropdown,
body:not(.dark-mode) .select2-search--dropdown {
    background-color: #ffffff !important;
    border-color: #cbd5e1 !important;
    color: #0f172a !important;
}

body:not(.dark-mode) .select2-search--dropdown .select2-search__field {
    background-color: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 6px !important;
    color: #0f172a !important;
    -webkit-text-fill-color: #0f172a !important;
}

body:not(.dark-mode) .select2-results__option,
body:not(.dark-mode) .select2-container--default .select2-results__option {
    background-color: #ffffff !important;
    color: #0f172a !important;
    -webkit-text-fill-color: #0f172a !important;
}

body:not(.dark-mode) .select2-results__option[aria-selected="true"],
body:not(.dark-mode) .select2-container--default .select2-results__option--selected {
    background-color: #e0ecff !important;
    color: #0f172a !important;
    -webkit-text-fill-color: #0f172a !important;
}

body:not(.dark-mode) .select2-results__option--highlighted[aria-selected],
body:not(.dark-mode) .select2-container--default .select2-results__option--highlighted.select2-results__option--selectable {
    background-color: #2563eb !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

/* Button Upgrades */
body .swal2-confirm {
    background: linear-gradient(135deg, #3b82f6, #2563eb) !important;
    box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.2) !important;
}

body .swal2-cancel {
    background: #334155 !important; /* Slate 700 */
    color: #cbd5e1 !important;
}

body .swal2-cancel:hover {
    background: #475569 !important;
    color: #fff !important;
}

/* =========================================
   Luxury & Minimalist Overrides (Mobile First)
   ========================================= */

/* Typography & Layout Refinements */
body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-size: 14px;
    font-weight: 300;
    color: #334155;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 500;
    letter-spacing: -0.015em;
    color: #1e293b;
}

/* Button Refinements (Smaller, Premium) */
button, .btn {
    font-size: 13px !important;
    padding: 7px 16px !important;
    border-radius: 8px !important;
    font-weight: 400 !important;
    letter-spacing: 0.01em !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05), inset 0 1px 0 rgba(255,255,255,0.1) !important;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
    border: 1px solid transparent;
}

button:hover, .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.08), 0 2px 4px -1px rgba(0,0,0,0.04) !important;
}

/* Form Elements (Minimalist) */
input[type="text"], input[type="date"], input[type="number"], input[type="password"], select, textarea, .custom-input, .custom-select {
    font-size: 13px !important;
    padding: 8px 14px !important;
    border-radius: 8px !important;
    border: 1px solid #e2e8f0 !important;
    font-weight: 300 !important;
    background-color: #f8fafc !important;
    transition: all 0.2s ease !important;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.01) !important;
    color: #334155 !important;
}

input:focus, select:focus, textarea:focus {
    background-color: #ffffff !important;
    border-color: #94a3b8 !important;
    box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.15) !important;
    outline: none !important;
}

/* Data Tables (Clean & Spacious) */
table {
    border-collapse: separate !important;
    border-spacing: 0 !important;
    width: 100% !important;
    border: 1px solid #f1f5f9;
    border-radius: 8px;
    overflow: hidden;
}

table th, table td {
    font-size: 13px !important;
    padding: 12px 16px !important;
    font-weight: 300 !important;
    border-bottom: 1px solid #f1f5f9 !important;
    color: #475569;
}

table thead th {
    font-weight: 500 !important;
    background: #f8fafc !important;
    color: #64748b !important;
    text-transform: uppercase;
    font-size: 11px !important;
    letter-spacing: 0.05em;
    border-bottom: 1px solid #e2e8f0 !important;
    padding-top: 14px !important;
    padding-bottom: 14px !important;
}

table tbody tr:hover td {
    background-color: #f8fafc !important;
}

/* Dashboard Cards (Subtle shadows) */
div[style*="background: white"], 
div[style*="background-color: white"] {
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.02), 0 2px 4px -1px rgba(0,0,0,0.02) !important;
    border: 1px solid #f1f5f9 !important;
    border-radius: 12px !important;
}

/* Labels and Small text */
label {
    font-size: 12px !important;
    font-weight: 500 !important;
    color: #64748b !important;
    margin-bottom: 4px;
    display: block;
}

/* Dark Mode Extends */
body.dark-mode {
    color: #cbd5e1 !important;
}

body.dark-mode h1, body.dark-mode h2, body.dark-mode h3, body.dark-mode h4, body.dark-mode h5, body.dark-mode h6 {
    color: #f8fafc !important;
}

body.dark-mode input[type="text"], body.dark-mode input[type="date"], body.dark-mode input[type="number"], body.dark-mode select, body.dark-mode textarea {
    background-color: #0f172a !important;
    border-color: #334155 !important;
    color: #e2e8f0 !important;
}

body.dark-mode table {
    border-color: #1e293b !important;
}

body.dark-mode table thead th {
    background: #0f172a !important;
    color: #94a3b8 !important;
    border-bottom: 1px solid #1e293b !important;
}

body.dark-mode table th, body.dark-mode table td {
    border-bottom: 1px solid #1e293b !important;
    color: #cbd5e1;
}

body.dark-mode table tbody tr:hover td {
    background-color: #1e293b !important;
}

body.dark-mode div[style*="background: white"], 
body.dark-mode div[style*="background-color: white"] {
    border-color: #1e293b !important;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06) !important;
}

body.dark-mode label {
    color: #94a3b8 !important;
}
