body {
    font-family: 'Prompt', sans-serif;
    background: linear-gradient(to right, #2c3e50, #4ca1af);
    padding: 30px;
}

h2 {
    color: #fff;
    text-align: center;
    margin-bottom: 30px;
    text-shadow: 1px 1px 4px rgba(0,0,0,0.2);
}
.table-container {
    background: white;
    padding: 20px;
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}
table.dataTable thead {
    background-color: #68d2e8;
    color: white;
}
table.dataTable tbody tr:hover {
    background-color: #f0faff;
}
.dataTables_wrapper .dataTables_filter input {
    border-radius: 12px;
    border: 1px solid #ccc;
    padding: 5px 10px;
    width: 200px;
}
.dataTables_wrapper .dataTables_paginate .paginate_button {
    border-radius: 8px;
    margin: 0 2px;
    background-color: #f0f0f0;
}
.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background-color: #68d2e8;
    color: white !important;
    border: none;
}
.add-btn {
    display: inline-block;
    margin-bottom: 20px;
    background: #4CAF50; /* สีเขียว */
    color: #fff;
    padding: 10px 20px;
    border-radius: 10px;
    text-decoration: none;
}
.add-btn:hover {
    background: #45a049; /* สีเขียวเข้มเมื่อชี้เมาส์ */
}

.form-container {
    background: white;
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    max-width: 600px;
    margin: 0 auto;
}
.form-container input,
.modal input,
.form-container select {
    width: 100%;                /* Ensures both input and select elements have the same width */
    padding: 10px;              /* Adds consistent padding */
    margin-bottom: 15px;        /* Adds space between elements */
    border-radius: 10px;        /* Rounds the corners */
    border: 1px solid #ccc;     /* Applies a light border */
    box-sizing: border-box;     /* Includes padding and border in the width calculation */
}

.form-container button {
    width: 100%;
    background: #68d2e8;
    border: none;
    padding: 10px;
    color: white;
    border-radius: 10px;
    font-size: 16px;
}
form button[type="submit"].submit-btn {
    width: 70%;
    background: #4CAF50;
    color: white;
    padding: 10px 0; /* ตั้งค่าความสูงแบบเต็ม */
    border-radius: 10px;
    text-decoration: none;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
    height: 100%; /* เพิ่มให้มีความสูงเต็มที่ */
}

form button[type="submit"].submit-btn:hover {
    background: #45a049;
}
.form-container button:hover {
    background: #4bb7cd;
}
table.dataTable th {
    text-align: center !important;
    vertical-align: middle !important;
}

table.dataTable td:nth-child(2) {
    text-align: left;
}
    /* Modal styles */
    .staff-btn {
        /* display: inline-block; */
        /* margin-top: 20px; */
        background: #FF6347; /* Tomato color */
        color: white;
        padding: 12px 24px;
        border-radius: 10px;
        font-size: 16px;
        font-weight: bold;
        text-decoration: none;
        /* position: absolute; */
        /* top: 20px; */
        /* right: 30px; */
        transition: background 0.3s;
    }

    .staff-btn:hover {
        background: #e55347; /* Darker Tomato */
    }
    .modal {
        display: none; 
        position: fixed;
        z-index: 1;
        left: 0;
        top: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.5);
    }
    .modal-content {
        background-color: white;
        margin: 15% auto;
        padding: 20px;
        border-radius: 10px;
        width: 300px;
    }
    .modal button {
        background: #4CAF50;
        color: white;
        padding: 10px;
        border-radius: 10px;
        border: none;
        width: 100%;
        cursor: pointer;
    }
    .modal button:hover {
        background: #45a049;
    }
    .close {
        color: #aaa;
        font-size: 28px;
        font-weight: bold;
        position: absolute;
        top: 10px;
        right: 15px;
    }
    .close:hover,
    .close:focus {
        color: black;
        text-decoration: none;
        cursor: pointer;
    }

    /* Modal background */
    .modal {
        display: none;
        position: fixed;
        z-index: 9999;
        padding-top: 60px;
        left: 0;
        top: 0;
        width: 100%;
        height: 100%;
        overflow: auto;
        background-color: rgba(0, 0, 0, 0.4);
        font-family: 'Prompt', sans-serif;
    }

    /* Modal content */
    .modal-content {
        background-color: #fff;
        margin: auto;
        padding: 30px 40px;
        border: 1px solid #ccc;
        width: 90%;
        max-width: 600px;
        border-radius: 16px;
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
        position: relative;
        animation: fadeIn 0.3s ease-in-out;
    }

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

    .modal-content h3 {
        margin-top: 0;
        font-size: 24px;
        color: #333;
        text-align: center;
    }

    .modal-content p {
        font-size: 16px;
        color: #444;
        margin: 12px 0;
        line-height: 1.6;
        display: flex;
        justify-content: space-between;
    }

    .modal-content p strong {
        color: #222;
        min-width: 180px;
        display: inline-block;
    }

    .modal-content img {
        border-radius: 8px;
        border: 1px solid #ddd;
        margin-top: 10px;
    }

    .close {
        position: absolute;
        right: 20px;
        top: 20px;
        font-size: 24px;
        color: #888;
        cursor: pointer;
        transition: color 0.2s;
    }

    .close:hover {
        color: #e53935;
    }
    #statusDropdown {
        width: 100%;
        padding: 10px;
        margin-bottom: 20px;
    }
    
    #saveStatusBtn {
        padding: 10px 20px;
        background-color: #4CAF50;
        color: white;
        border: none;
        cursor: pointer;
    }
    
    #saveStatusBtn:hover {
        background-color: #45a049;
    }

/* Responsive Design */
@media screen and (max-width: 768px) {
    body {
        padding: 15px;
    }

    .table-container {
        padding: 10px;
        overflow-x: auto;
    }

    .dataTables_wrapper .dataTables_filter input {
        width: 100%;
        margin-bottom: 10px;
    }

    .form-container {
        padding: 20px;
        margin: 10px;
    }

    .modal-content {
        width: 95%;
        margin: 10px auto;
        padding: 20px;
    }

    .staff-btn {
        width: 100%;
        margin: 10px 0;
        text-align: center;
    }

    table.dataTable {
        font-size: 14px;
    }

    .add-btn {
        width: 100%;
        text-align: center;
    }

    form button[type="submit"].submit-btn {
        width: 100%;
    }
}

@media screen and (max-width: 480px) {
    body {
        padding: 10px;
    }

    h2 {
        font-size: 20px;
        margin-bottom: 20px;
    }

    .table-container {
        padding: 5px;
    }

    .form-container input,
    .modal input,
    .form-container select {
        font-size: 16px; /* Prevents zoom on iOS */
    }

    .modal-content {
        padding: 15px;
    }

    .modal-content h3 {
        font-size: 20px;
    }

    .modal-content p {
        font-size: 14px;
    }

    .modal-content p strong {
        min-width: 120px;
    }
}

/* Fix for iOS input zoom */
@supports (-webkit-touch-callout: none) {
    input, select, textarea {
        font-size: 16px !important;
    }
}

/* Improve table responsiveness */
.table-responsive {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Improve button touch targets */
button, 
.add-btn,
.staff-btn,
.submit-btn {
    min-height: 44px; /* Minimum touch target size */
    touch-action: manipulation;
}

/* Improve form elements for touch */
input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
select,
textarea {
    touch-action: manipulation;
    -webkit-appearance: none;
    appearance: none;
}

/* Improve modal scrolling on mobile */
.modal {
    -webkit-overflow-scrolling: touch;
}

/* Fix for sticky hover states on mobile */
@media (hover: none) {
    .add-btn:hover,
    .staff-btn:hover,
    .submit-btn:hover,
    .form-container button:hover {
        background: inherit;
    }
}