/* ============================================================
   Base.css - Global Styles for Match & Score
   จัดระเบียบโดย Kittakorn Sriwanna
   ============================================================ */

/* ============================================================
   1. Reset & Base Styles
   ============================================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: rgb(204, 192, 200);
}

html,
body {
    overflow-x: hidden;
}

/* ============================================================
   2. Typography
   ============================================================ */
h1,
h2,
h3,
h4,
h5,
h6 {
    color: rgb(102, 20, 66);
}

h1 {
    font-size: 16pt;
    font-weight: 600;
}

h2 {
    font-size: 1.44rem;
}

h3 {
    font-size: 1.32rem;
}

h4 {
    font-size: 1.22rem;
}

h5 {
    font-size: 1.1rem;
}

.text_color1 {
    color: #fb9337;
}

.color1 {
    color: rgb(82, 0, 46);
}

.lia1,
.lia2 {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: inline-block;
}

.lia1 {
    min-width: 105px;
}

/* ============================================================
   3. Layout & Containers
   ============================================================ */
.card {
    width: 100%;
    max-width: 100%;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: none;
}

.pd-20 {
    padding: 25px;
}

.toolbar {
    float: left;
}

.inline-form {
    display: inline-block;
}

/* Container Queries */
.auto-size-container {
    container-type: inline-size;
    width: 100%;
}

.auto-size-input {
    min-width: 60px;
    width: 100%;
}

@media (min-width: 300px) {
    .auto-size-input {
        width: auto;
        max-width: 400px;
    }
}

@supports (container-type: inline-size) {
    @container (min-width: 300px) {
        .auto-size-input {
            width: auto;
            max-width: 400px;
        }
    }
}

/* ============================================================
   4. Form Elements
   ============================================================ */
.form-label {
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 6px;
    color: #334155;
    display: block;
}

.form-control {
    border-radius: 8px;
    border: 1px solid #cbd5e0;
    padding: 8px 12px;
    transition: all 0.2s ease;
    font-size: 14px;
    width: 100%;
}

.form-control:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    outline: none;
}

.jaa {
    margin: 0;
    padding: 0;
}

.errorlist {
    color: rgb(160, 4, 40);
}

.text-danger {
    font-size: 12px;
    margin-top: 4px;
    color: #ef4444 !important;
}

/* ============================================================
   5. Button Styles
   ============================================================ */
/* ปุ่มทั่วไปที่ไม่มีคลาส btn */
button:not(.btn) {
    background: linear-gradient(135deg, rgb(82, 0, 46), rgb(44, 0, 27));
    border: none;
    color: white;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.btn {
    border-radius: 8px;
    padding: 8px 20px;
    font-weight: 500;
    transition: all 0.2s;
    font-size: 14px;
    border: none;
    cursor: pointer;
    will-change: transform;
}

.btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.btn-success:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-secondary {
    background: #64748b;
    color: white;
}

.btn-secondary:hover {
    background: #475569;
    transform: translateY(-1px);
}

.btn-save,
.btn-danger,
.btn-delete {
    padding: 10px 32px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 120px;
    justify-content: center;
    border: none;
    cursor: pointer;
}

.btn-save {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}

.btn-save:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
    color:white
}

.btn-danger,
.btn-delete {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
}

.btn-danger:hover,
.btn-delete:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
    color: white;
}

.btn-edit {
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
    color: white;
    padding: 10px 32px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 120px;
    justify-content: center;
    border: none;
    cursor: pointer;
}

.btn-edit:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(217, 119, 6, 0.3);
    color: white;
}

.btn-add {
    background: linear-gradient(135deg, #0f2b5e, #1e3a8a);
    color: white;
    border: none;
    padding: 10px 32px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 120px;
    justify-content: center;
}

.btn-add:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(31, 58, 138, 0.3);
    color: white;
}

/* Custom Button Variants */
.btnja1,
.btnja2,
.btnja3,
.btnja4,
.btnja5,
.btnja6,
.btnja7,
.btnja8,
.alert_development,
.alert_match {
    min-width: 12px;
    padding: 9px;
    border: 1px solid white;
    border-radius: 7px;
    color: white;
}

.btnja1 {
    background-color: rgb(122, 40, 86);
}

.btnja2 {
    background-color: rgb(100, 62, 86);
}

.btnja3 {
    background-color: rgb(84, 82, 82);
}

.btnja4 {
    background-color: rgb(82, 0, 46);
}

.btnja5 {
    background-color: rgb(20, 20, 82);
}

.btnja6 {
    background-color: rgb(10, 90, 32);
}

.btnja7 {
    background-color: rgb(120, 10, 22);
}

.btnja8 {
    background-color: rgb(204, 85, 10);
}

.alert_development,
.alert_match {
    background-color: rgb(100, 100, 100);
}

.btnpaid {
    min-width: 12px;
    padding: 4px;
    background-color: rgb(10, 90, 32);
    border: 1px solid white;
    border-radius: 7px;
    color: white;
}

.button_register {
    padding: 8px 5px;
    min-width: 140px;
    font-size: 10pt;
}

.bt_rank {
    display: inline-block;
    outline: 0;
    border: 1px solid #1d1c1d4d;
    font-weight: 500;
    background: #fff;
    padding: 3px;
    margin-bottom: 5px;
    font-size: 9pt;
    border-radius: 6px;
    text-align: center;
    color: rgb(29, 28, 29);
    min-width: 20px;
}

.bt_date {
    display: inline-block;
    outline: 0;
    font-weight: 400;
    background: rgb(100, 62, 86);
    padding: 4px;
    margin-bottom: 5px;
    font-size: 9pt;
    border-radius: 6px;
    text-align: center;
    color: white;
    min-width: 20px;
}

.sign_in_up {
    border-radius: 10px;
    border: 2px solid #FB9337;
    background-color: transparent;
    color: white;
    padding: 5px;
}

.btn-back {
    background: #64748b;
    color: white;
    border: none;
    padding: 10px 28px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-back:hover {
    background: #475569;
    transform: translateY(-1px);
    color: white;
    text-decoration: none;
}

/* ============================================================
   6. Header & Navigation
   ============================================================ */
.am-header {
    background-color: rgb(82, 0, 46);
}

.am-header-right .dropdown-menu {
    background-color: rgb(44, 0, 27);
}

.am-header-right .dropdown-menu a:hover {
    background-color: rgb(24, 0, 7);
}

li a.active {
    font-weight: bold;
}

/* ============================================================
   Sidebar Tabs - Horizontal Layout
   ============================================================ */
.am-sideleft-tab {
    display: flex;
    flex-direction: row;
    /* เรียงแนวนอน */
    /* justify-content: center;    */
    background-color: rgb(82, 0, 46);
    /* gap: 3px;    */
    /* align-items: center; */
    padding: 0;
    margin: 0;
    /* list-style: none; */
}

.am-sideleft-tab .nav-item {
    width: auto;
    /* ปรับตามเนื้อหา */
    height: 60px;
    min-width: 50px;
    margin: 0;
    border-right: none;
    /* ลบเส้นขอบด้านข้าง */
}

.am-sideleft-tab .nav-link {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 15px;
    height: 100%;
    background: transparent;
    color: rgb(44, 0, 27);
    transition: all 0.25s ease;
    border-radius: 0;
    position: relative;
}

.am-sideleft-tab .nav-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    /* background-color: rgb(140, 102, 126); */
    background-color: rgb(82, 0, 46);
    color: rgba(255, 255, 255, 0.7);
    position: relative;
}

.am-sideleft-tab .nav-link.active {
    background-color: white;
    /* color: #FB9337; */
    color: rgb(204, 85, 10);
}

/* active indicator (เส้นใต้) */
.am-sideleft-tab .nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 3px;
    /* background: #FB9337; */
    border-radius: 3px 3px 0 0;
}

/* ไอคอนขนาด */
.am-sideleft-tab .nav-link i {
    font-size: 24px;
}

/* Responsive */
@media (max-width: 767.98px) {
    .am-sideleft-tab .nav-item {
        height: 50px;
    }

    .am-sideleft-tab .nav-link i {
        font-size: 20px;
    }
}

/* ============================================================
   8. Sidebar & Mainpanel (Desktop & Mobile)
   ============================================================ */
.am-sideleft {
    transition: left 0.2s ease;
    left: -240px;
}

.am-mainpanel {
    transition: margin-left 0.2s ease;
}

@media (min-width: 992px) {
    .am-sideleft:not(.am-collapsed) {
        left: 0 !important;
    }

    .am-sideleft:not(.am-collapsed)~.am-mainpanel {
        margin-left: 240px;
    }
}

@media (max-width: 991px) {
    .am-sideleft {
        position: fixed;
        top: 60px;
        left: -240px;
        width: 240px;
        height: calc(100vh - 60px);
        z-index: 2000;
        transition: left 0.2s ease;
    }

    .am-sideleft.mobile-open {
        left: 0;
    }

    .am-mainpanel {
        position: relative;
        z-index: 1;
        margin-left: 0 !important;
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }

    .am-pagebody {
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }

    .sidebar-overlay {
        position: fixed;
        top: 60px;
        left: 0;
        width: 100%;
        height: calc(100vh - 60px);
        background: rgba(0, 0, 0, 0.5);
        z-index: 1990;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.2s ease, visibility 0.2s ease;
    }

    .sidebar-overlay.active {
        opacity: 1;
        visibility: visible;
    }
}

/* ============================================================
   9. Dropdown Profile & Language Selector
   ============================================================ */
/* ---------- Dropdown Profile ---------- */
.dropdown-profile .nav-link-profile {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 40px;
    background: rgba(255, 255, 255, 0.08);
    transition: all 0.25s ease;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.dropdown-profile .nav-link-profile:hover {
    background: rgba(255, 255, 255, 0.18);
    transform: translateY(-1px);
    border-color: rgba(255, 255, 255, 0.3);
}

.dropdown-profile .logged-name {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(0, 0, 0, 0.3);
    padding: 4px 12px 4px 6px;
    border-radius: 40px;
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.2s;
}

.dropdown-profile .logged-name:hover {
    outline: none;
    border-color: #FB9337;
    box-shadow: 0 0 0 2px rgba(251, 147, 55, 0.3);
}

.dropdown-profile .logged-name .profile-img {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid #FB9337;
}

.dropdown-profile .logged-name .user-name {
    color: white;
    font-size: 13px;
    font-weight: 500;
}

.dropdown-profile .logged-name i {
    font-size: 12px;
    color: white;
    margin-left: 2px;
}

.dropdown-profile .dropdown-menu {
    background: linear-gradient(135deg, #2d3a50 0%, #1f2a3a 100%);
    border: none;
    border-radius: 16px;
    padding: 8px 0;
    margin-top: 12px;
    box-shadow: 0 15px 30px -10px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(8px);
    min-width: 220px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.dropdown-profile .dropdown-menu::before {
    content: '';
    position: absolute;
    top: -8px;
    right: 20px;
    width: 16px;
    height: 16px;
    background: linear-gradient(135deg, #2d3a50, #1f2a3a);
    transform: rotate(45deg);
    border-radius: 3px;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.dropdown-profile .user-profile-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    color: #e2e8f0;
    font-size: 14px;
    transition: all 0.2s;
    text-decoration: none;
}

.dropdown-profile .user-profile-nav a i,
.dropdown-profile .user-profile-nav a .icon {
    width: 20px;
    font-size: 18px;
    color: #FB9337;
}

.dropdown-profile .user-profile-nav a:hover {
    background: rgba(251, 147, 55, 0.2);
    color: #fff;
    padding-left: 24px;
}

.dropdown-profile .dropdown-divider {
    border-top-color: rgba(255, 255, 255, 0.1);
    margin: 6px 0;
}

@media (max-width: 767.98px) {
    .dropdown-profile .logged-name {
        padding: 4px 8px;
        gap: 4px;
    }

    .dropdown-profile .logged-name .profile-img {
        width: 30px;
        height: 30px;
    }

    .dropdown-profile .logged-name i {
        font-size: 10px;
    }
}

/* ---------- Language Selector ---------- */
.select_lang {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 30px;
    padding: 6px 28px 6px 14px;
    font-size: 13px;
    font-weight: 500;
    color: #ffffff;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    transition: all 0.2s ease;
    backdrop-filter: blur(4px);
    text-align: center;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'></polyline></svg>");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 12px;
}

.select_lang:hover {
    background-color: rgba(0, 0, 0, 0.5);
    border-color: rgba(255, 255, 255, 0.4);
}

.select_lang:focus {
    outline: none;
    border-color: #FB9337;
    box-shadow: 0 0 0 2px rgba(251, 147, 55, 0.3);
}

.select_lang option {
    background: #2d3a50;
    color: #fff;
    padding: 8px;
}

@media (max-width: 767.98px) {
    .select_lang {
        padding: 5px 24px 5px 12px;
        font-size: 12px;
        background-size: 10px;
        background-position: right 10px center;
    }
}

/* ============================================================
   10. Toast Notifications
   ============================================================ */
#toast-container {
    position: fixed;
    top: 70px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast-message {
    min-width: 250px;
    max-width: 350px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    animation: slideInRight 0.3s ease-out;
    border-left: 4px solid;
    font-size: 14px;
}

.toast-message i {
    font-size: 18px;
}

.toast-message .toast-text {
    flex: 1;
    color: #1e293b;
}

.toast-message .toast-close {
    cursor: pointer;
    opacity: 0.6;
    font-size: 18px;
    transition: opacity 0.2s;
}

.toast-message .toast-close:hover {
    opacity: 1;
}

/* Toast types */
.toast-message.success {
    border-left-color: #28a745;
    background: #f0fdf4;
}

.toast-message.success i {
    color: #28a745;
}

.toast-message.error {
    border-left-color: #dc3545;
    background: #fef2f2;
}

.toast-message.error i {
    color: #dc3545;
}

.toast-message.warning {
    border-left-color: #ffc107;
    background: #fffbeb;
}

.toast-message.warning i {
    color: #ffc107;
}

.toast-message.info {
    border-left-color: #17a2b8;
    background: #f0f9ff;
}

.toast-message.info i {
    color: #17a2b8;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast-fade-out {
    animation: fadeOut 0.5s ease forwards;
}

@keyframes fadeOut {
    to {
        opacity: 0;
        transform: translateX(100%);
        visibility: hidden;
    }
}

/* ============================================================
   11. Background Images & Loading Spinner
   ============================================================ */
.bgimg {
    background: url('/media/ball.png') no-repeat center;
    background-size: contain;
    padding: 11px;
    color: rgb(82, 0, 46);
    text-shadow: -1px 0 white, 0 1px white, 1px 0 white, 0 -1px white;
    font-weight: 800;
}

.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #e2e8f0;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-right: 8px;
}

.loading-spinner-small {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid white;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin-right: 5px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ============================================================
   12. Icon Animation (Navicon)
   ============================================================ */
.am-navicon i {
    transition: transform 0.3s ease;
    display: inline-block;
}

.am-navicon.active i {
    transform: rotate(90deg);
}

@keyframes iconFlip {
    0% {
        transform: rotateY(0deg) scale(1);
        opacity: 1;
    }

    50% {
        transform: rotateY(90deg) scale(0.5);
        opacity: 0;
    }

    100% {
        transform: rotateY(180deg) scale(1);
        opacity: 1;
    }
}

.icon-animate {
    animation: iconFlip 0.5s cubic-bezier(0.34, 1.2, 0.64, 1);
}

/* ============================================================
   13. Formset, Table, Filter, DataTable
   ============================================================ */
.formset-container {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
}

.formset-header {
    text-align: left;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid rgb(82, 0, 46);
}

.formset-header h4 {
    font-size: 20px;
    font-weight: 600;
    color: rgb(82, 0, 46);
    margin: 0;
}

.formset-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.formset-table th {
    padding: 12px 10px;
    background: linear-gradient(135deg, rgb(102, 20, 66), rgb(82, 0, 46));
    color: white;
    font-weight: 600;
    font-size: 13px;
    text-align: center;
    border: none;
}

.formset-table td {
    padding: 10px;
    border-bottom: 1px solid #e2e8f0;
    vertical-align: middle;
}

.formset-table input[type="text"],
.formset-table input[type="number"],
.formset-table input[type="date"],
.formset-table select {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #cbd5e0;
    border-radius: 6px;
    font-size: 13px;
    transition: all 0.2s;
    box-sizing: border-box;
}

.formset-table input:focus,
.formset-table select:focus {
    outline: none;
    border-color: rgb(82, 0, 46);
    box-shadow: 0 0 0 2px rgba(82, 0, 46, 0.1);
}

.formset-table input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: rgb(82, 0, 46);
}

.delete-btn {
    background: none;
    border: none;
    color: #ef4444;
    font-size: 16px;
    cursor: pointer;
    padding: 5px 8px;
    border-radius: 6px;
    transition: all 0.2s;
}

.delete-btn:hover {
    background: #fef2f2;
    color: #dc2626;
}

.row-deleted {
    opacity: 0.5;
    background-color: #fef2f2;
}

.row-deleted input,
.row-deleted select {
    background-color: #fef2f2;
}

.action-bar {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 20px 0;
}

.action-bar-left {
    display: flex;
    justify-content: flex-start;
    margin-top: 15px;
}

.filter-bar {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 25px;
    padding: 12px 0;
    border-bottom: 1px solid #e2e8f0;
}

.filter-status {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.status-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.status-badge-filter {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 14px;
    background: #f1f5f9;
    border-radius: 20px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid #e2e8f0;
}

.status-badge-filter:hover {
    background: #e2e8f0;
}

.status-badge-filter.active {
    background: rgb(82, 0, 46);
    border-color: rgb(82, 0, 46);
    color: white !important;
}

.status-badge-filter.active .badge-text {
    color: white !important;
}

.status-badge-filter input[type="checkbox"] {
    display: none;
}

.status-badge-filter .badge-text {
    user-select: none;
}

.custom-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    margin: 20px 0;
    padding: 0 5px;
}

.toolbar-left {
    flex-shrink: 0;
}

.toolbar-right {
    flex-shrink: 0;
}

.team-info {
    font-weight: 600;
    margin-bottom: 5px;
}

.registration-date {
    font-size: 11px;
    color: #94a3b8;
    margin-top: 5px;
}

.dataTables_filter {
    margin: 0 !important;
    float: none !important;
    text-align: right !important;
}

.dataTables_filter label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-weight: normal;
}

.dataTables_filter input {
    padding: 6px 12px;
    border: 1px solid #cbd5e0;
    border-radius: 8px;
    width: 250px;
}

.dataTables_wrapper .toolbar {
    display: none;
}

.dataTables_scrollBody {
    max-height: 450px !important;
}

#datatable1 td {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 200px;
}

#datatable1 td:nth-child(2) {
    white-space: normal;
}

/* Dropdown Menu Styles */
.table-wrapper,
.dataTables_wrapper,
.dataTables_scroll,
.dataTables_scrollBody,
.dataTable {
    overflow: visible !important;
}

.dropdown-action {
    position: relative;
    z-index: 100;
}

.dropdown-action .dropdown-menu-custom {
    position: absolute;
    z-index: 99999;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    min-width: 180px;
    padding: 8px 0;
    border: 1px solid #e2e8f0;
    top: 100%;
    left: 0;
    margin-top: 4px;
}

.dropdown-action .dropdown-menu-custom a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    text-decoration: none;
    color: #1e293b;
    font-size: 13px;
    transition: all 0.2s;
    white-space: nowrap;
}

.dropdown-action .dropdown-menu-custom a:hover {
    background-color: #f1f5f9;
}

.dropdown-action .dropdown-menu-custom a i {
    width: 20px;
    color: rgb(82, 0, 46);
}

/* Competition Header */
.competition-header {
    text-align: center;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    padding: 10px 15px;
    border-radius: 12px;
    margin-bottom: 30px;
    border-bottom: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.competition-header h5 {
    font-size: 20px;
    font-weight: 700;
    color: rgb(82, 0, 46);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin: 0;
}

.competition-header h5 i {
    font-size: 28px;
    color: rgb(82, 0, 46);
    background: white;
    padding: 10px;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.competition-header p {
    margin: 5px 0 0 0;
    font-size: 14px;
    color: #64748b;
    line-height: 1.6;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.competition-header p i {
    font-size: 14px;
    color: rgb(82, 0, 46);
}

/* Add/Edit Competition Form */
.form-container {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
}

.form-table {
    width: 100%;
    margin-bottom: 20px;
    border-collapse: collapse;
}

.form-table th {
    width: 180px;
    padding: 12px 15px;
    text-align: left;
    vertical-align: top;
    font-weight: 600;
    background-color: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.form-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #e2e8f0;
}

.form-table input[type="text"],
.form-table input[type="number"],
.form-table input[type="email"],
.form-table input[type="password"],
.form-table input[type="file"],
.form-table select,
.form-table textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #cbd5e0;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s;
    box-sizing: border-box;
}

.form-table input[type="checkbox"],
.form-table input[type="radio"] {
    width: auto;
    margin-right: 8px;
}

.form-table input:focus,
.form-table select:focus,
.form-table textarea:focus {
    outline: none;
    border-color: rgb(82, 0, 46);
    box-shadow: 0 0 0 2px rgba(82, 0, 46, 0.1);
}

.help-text {
    font-size: 12px;
    color: #64748b;
    margin-top: 4px;
    display: block;
}

.errorlist {
    color: #dc2626;
    font-size: 12px;
    list-style: none;
    padding: 0;
    margin: 4px 0 0 0;
}

.image-preview {
    max-width: 150px;
    max-height: 150px;
    border-radius: 8px;
    margin-top: 8px;
    border: 1px solid #e2e8f0;
}

.action-buttons-center {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-top: 25px;
    margin-bottom: 15px;
}

.action-buttons-left {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    margin-top: 0;
}

.form-header {
    text-align: left;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid rgb(82, 0, 46);
}

.form-header h4 {
    font-size: 18px;
    font-weight: 600;
    color: rgb(82, 0, 46);
    margin: 0;
}

.type-table-scroll .formset-table {
    min-width: 700px;
}

.team-size-group {
    display: flex;
    gap: 5px;
    align-items: center;
}

.team-size-group input {
    width: 70px;
    min-width: 60px;
}

/* ============================================================
   14. Responsive Utilities
   ============================================================ */
@media screen and (max-width: 550px) {
    .hide_responsive {
        display: none;
    }
}

@media (max-width: 768px) {
    .btn {
        padding: 6px 14px;
        font-size: 13px;
    }

    .pd-20 {
        padding: 15px;
    }

    .btn-save,
    .btn-danger,
    .btn-delete,
    .btn-edit,
    .btn-add {
        padding: 8px 20px;
        min-width: 100px;
        font-size: 13px;
    }

    .table-scroll {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin-bottom: 15px;
        width: 100%;
    }

    .formset-table {
        min-width: 550px;
        width: 100%;
    }

    .formset-table th,
    .formset-table td {
        padding: 8px 6px;
        font-size: 12px;
    }

    .formset-table input {
        padding: 6px 8px;
        font-size: 12px;
    }

    .action-bar {
        flex-direction: row;
        justify-content: center;
        gap: 12px;
        flex-wrap: wrap;
    }

    .btn-back {
        padding: 8px 20px;
        font-size: 13px;
    }

    /* Competition Team Responsive */
    .filter-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }

    .filter-status {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .status-badges {
        gap: 8px;
    }

    .custom-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .toolbar-left,
    .toolbar-right {
        width: 100%;
    }

    .dataTables_filter {
        text-align: left !important;
    }

    .dataTables_filter input {
        width: 100%;
    }

    .table-wrapper {
        overflow-x: auto;
    }

    #datatable1 {
        min-width: 600px;
    }

    .lia1 {
        white-space: normal;
        word-break: break-word;
        max-width: 180px;
        min-width: auto;
    }

    .dropdown-action .dropdown-menu-custom {
        position: absolute;
        left: 0;
        right: auto;
        width: auto;
        min-width: 180px;
        transform: none;
    }

    /* Add/Edit Competition Form Responsive */
    .form-table,
    .form-table tbody,
    .form-table tr,
    .form-table th,
    .form-table td {
        display: block;
    }

    .form-table th {
        width: 100%;
        padding: 10px 12px 5px 12px;
        border-bottom: none;
    }

    .form-table td {
        padding: 5px 12px 15px 12px;
    }

    .action-buttons-center {
        flex-direction: row;
        justify-content: center;
        gap: 15px;
    }

    .type-table-scroll .formset-table {
        min-width: 700px;
    }
}

@media (max-width: 480px) {
    .formset-table {
        min-width: 480px;
    }

    .btn-save,
    .btn-danger,
    .btn-delete,
    .btn-edit,
    .btn-add {
        padding: 6px 16px;
        min-width: 90px;
        font-size: 12px;
    }

    .type-table-scroll .formset-table {
        min-width: 650px;
    }
}

@media (min-width: 481px) and (max-width: 768px) {
    .type-table-scroll .formset-table {
        min-width: 700px;
    }
}

/* ============================================================
   15. Table Action Bar & Global Filters
   ============================================================ */
.table-action-bar {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

.table-action-bar.align-left {
    justify-content: flex-start;
}

.table-action-bar.align-right {
    justify-content: flex-end;
}

.filter-label {
    font-weight: 500;
    color: #1e293b;
    font-size: 13px;
}

.status-badge-filter {
    cursor: pointer;
    padding: 5px 12px;
    border-radius: 20px;
    background: #f1f5f9;
    transition: all 0.2s;
    display: inline-block;
}

.status-badge-filter.active {
    background: linear-gradient(135deg, rgb(82, 0, 46), rgb(44, 0, 27));
    color: white;
}

.status-badge-filter input {
    display: none;
}

/* ============================================================
   16. Button Sizes
   ============================================================ */
.btn-sm {
    padding: 6px 10px !important;
    min-width: auto !important;
    font-size: 13px !important;
    gap: 4px !important;
}

.btn-xs {
    padding: 4px 8px !important;
    min-width: auto !important;
    font-size: 12px !important;
    gap: 4px !important;
}

/* ============================================================
   17. Misc
   ============================================================ */
a {
    text-decoration: none;
}

.tab-pane {
    padding-left: 10px !important;
}

@media (max-width: 992px) {
    .am-pagebody {
        padding: 0 !important;
    }

    .card.pd-20,
    .card.pd-10,
    .card.pd-sm-40 {
        padding: 0 !important;
    }

    .card {
        border-radius: 0 !important;
        margin: 0 !important;
        box-shadow: none !important;
    }
}

/* ============================================================
   Style for unstyled buttons (without btn class)
   ============================================================ */



/* Hover effect */
button:not(.btn):hover {
    background: linear-gradient(135deg, rgb(102, 20, 66), rgb(54, 10, 37));
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(82, 0, 46, 0.2);
}

/* Active (คลิก) */
button:not(.btn):active {
    transform: translateY(0);
    box-shadow: none;
}

/* ปุ่มที่ถูก disabled */
button:not(.btn):disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ปุ่มที่อยู่ในฟอร์มหรือในตาราง */
.form button:not(.btn),
.table button:not(.btn) {
    padding: 6px 12px;
    font-size: 12px;
}

/* ปุ่มที่มีเฉพาะไอคอน (ไม่มีข้อความ) */
button:not(.btn) i:only-child {
    font-size: 16px;
}

/* Responsive */
@media (max-width: 768px) {
    button:not(.btn) {
        padding: 6px 12px;
        font-size: 12px;
    }
}

h1 {
    text-align: left;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid rgb(82, 0, 46);
    font-size: 24px;
    font-weight: 600;
    color: rgb(82, 0, 46);
}
 /* Profile page custom styles */
 .profile-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
}
.profile-image-wrapper {
    text-align: center;
    margin-bottom: 25px;
}
.profile-image {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid #FB9337;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transition: transform 0.2s;
}
.profile-image:hover {
    transform: scale(1.02);
}
.profile-info-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    overflow: hidden;
    margin-bottom: 25px;
}
.profile-info-table {
    width: 100%;
    border-collapse: collapse;
}
.profile-info-table tr {
    border-bottom: 1px solid #e2e8f0;
}
.profile-info-table tr:last-child {
    border-bottom: none;
}
.profile-info-table th {
    background: #f8fafc;
    padding: 15px 20px;
    font-weight: 600;
    color: #1e293b;
    width: 35%;
    font-size: 14px;
    letter-spacing: 0.3px;
}
.profile-info-table td {
    padding: 15px 20px;
    color: #334155;
    font-size: 14px;
}
.edit-button-wrapper {
    text-align: center;
    margin-top: 20px;
}
.btn-edit-profile {
    background: linear-gradient(135deg, rgb(82, 0, 46), rgb(44, 0, 27));
    border: none;
    padding: 12px 32px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 40px;
    transition: all 0.2s;
    color: white;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.btn-edit-profile:hover {
    background: linear-gradient(135deg, rgb(102, 20, 66), rgb(54, 10, 37));
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(82,0,46,0.3);
    color: white;
}
@media (max-width: 768px) {
    .profile-container {
        padding: 15px;
    }
    .profile-info-table th,
    .profile-info-table td {
        padding: 12px 15px;
        display: block;
        width: 100%;
    }
    .profile-info-table tr {
        display: block;
        margin-bottom: 10px;
        border-bottom: 1px solid #e2e8f0;
    }
    .profile-info-table th {
        background: none;
        padding-bottom: 5px;
    }
    .profile-info-table td {
        padding-top: 0;
    }
}