/* Reset และ Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Prompt', sans-serif;
}

body {
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.4;
    font-size: 14px;
    height: 100vh;
    overflow: hidden;
    /* ป้องกัน scroll ทั้งหน้า */
}

.container {
    height: 100vh;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

/* ส่วนบน - Fixed */
.header-title {
    text-align: center;
    margin-bottom: 16px;
    margin-left: 12px;
    margin-right: 12px;
    margin-top: 12px;
    padding: 16px 12px 0 12px;
    background: white;
    flex-shrink: 0;
}

.header-title h1 {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 6px;
    color: #ffffff;
}

.header-title p {
    font-size: 14px;
    color: #a09dca;
    margin: 0;
}

.header-section {
    background: white;
    padding: 0 12px 0px 12px;
    border-bottom: 1px solid #E5E5EA;
    position: sticky;
    top: 0;
    z-index: 100;
    flex-shrink: 0;
}

/* Header Buttons */
.header-buttons {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

/* Search Box */
.search-box {
    margin-bottom: 12px;
}

/* Add New Button */
.add-new-section {
    margin-bottom: 16px;
}

/* ส่วนรายการ - เลื่อนได้ */
.list-section {
    flex: 1;
    overflow-y: auto;
    padding: 4px 16px 80px 12px;
    min-height: 0;
}
.btn {
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    flex: 1;
    text-align: center;
}

.btn-primary {
    background-color: #007AFF;
    color: white;
    border-bottom: 3px solid #0262c8;
     box-shadow: 0 2px 8px rgba(2, 32, 87, 0.28), 0 2px 6px rgba(0,0,0,0.12);
}

.btn-primary:active {
    background-color: #0056CC;
}

.btn-secondary {
    background-color: #ffa514;
    color: white;
    border-bottom: 3px solid #da8600;
     box-shadow: 0 2px 8px rgba(2, 32, 87, 0.28), 0 2px 6px rgba(0,0,0,0.12);
}

.btn-secondary:active {
    background-color: #6C6C70;
}

.btn-add {
    background-color: #296ae5;
    color: white;
    width: 100%;
    font-size: 1.6em;
    font-weight: 900;
    padding-top: 6px;
    padding-bottom: 5px;
    border-radius: 8px;
    border-bottom: 4px solid #0157b3;
    box-shadow: 0 4px 8px rgba(2, 32, 87, 0.28), 0 2px 6px rgba(0,0,0,0.12);
    transition: transform 0.14s ease, box-shadow 0.14s ease, background-color 0.12s ease;
}

.btn-add:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(41,106,229,0.32), 0 4px 10px rgba(0,0,0,0.14);
}

.btn-add:active {
    background-color: #2A9E47;
    transform: translateY(0);
    box-shadow: 0 4px 10px rgba(0,0,0,0.12);
}
/* Search Box */
.search-box {
    margin-bottom: 12px;
}

#search-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #C6C6C8;
    border-radius: 10px;
    font-size: 16px;
    background-color: white;
}

#search-input:focus {
    outline: none;
    border-color: #007AFF;
}

/* Add New Section */
.add-new-section {
    margin-bottom: 16px;
}

/* Emulators List */
.emulators-list {
    display: flex;
    flex-direction: column;
    gap: 1px;
    background-color: #E5E5EA;
}

.emulator-item {
    background-color: white;
    padding: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 60px;
}

.emulator-info {
    flex: 1;
    min-width: 0;
}

.emulator-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
}

.emulator-title {
    font-weight: 600;
    font-size: 16px;
    color: #000;
}

.emulator-actions {
    display: flex;
    gap: 8px;
}

.action-btn {
    background: none;
    border: none;
    padding: 6px;
    cursor: pointer;
    font-size: 16px;
    opacity: 0.7;
    margin-right: 15px;
}

.action-btn:active {
    opacity: 1;
    transform: scale(0.95);
}

.emulator-platform {
    font-size: 14px;
    color: #8E8E93;
}

/* No Results */
.no-results {
    text-align: center;
    padding: 40px 20px;
    color: #8E8E93;
    font-size: 16px;
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    animation: fadeIn 0.2s ease;
}

.modal-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-radius: 12px 12px 0 0;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
}

.modal-header {
    padding: 16px;
    border-bottom: 1px solid #E5E5EA;
    text-align: center;
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: #000;
}

/* Form Styles */
.modal-form {
    padding: 16px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #000;
    font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 4px;
    border: 1px solid #C6C6C8;
    border-radius: 8px;
    font-size: 16px;
    background-color: white;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #007AFF;
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

/* Platform Checkboxes */
.platform-checkboxes {
    display: flex;
    gap: 16px;
    margin-top: 8px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: normal;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
}

/* Form Actions */
.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.form-actions .btn {
    flex: 1;
}

.btn-cancel {
    background-color: #6ab4f0;
    color: white;
}

.btn-cancel:active {
    background-color: #D70015;
}

.btn-save {
    background-color: #34C759;
    color: white;
}

.btn-save:active {
    background-color: #2A9E47;
}

.btn-delete {
    background-color: #FF3B30;
    color: white;
}

.btn-delete:active {
    background-color: #D70015;
}

/* Delete Modal */
.modal-body {
    padding: 20px 16px;
    text-align: center;
}

.modal-body p {
    margin-bottom: 8px;
    color: #000;
}

.modal-actions {
    display: flex;
    gap: 12px;
    padding: 0 16px 16px;
}

.modal-actions .btn {
    flex: 1;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

/* Utility Classes */
.hidden {
    display: none !important;
}

/* Responsive */
@media (max-height: 700px) {
    .modal-content {
        max-height: 85vh;
    }
    
    .form-group {
        margin-bottom: 12px;
    }
    
    .modal-form {
        padding: 12px;
    }
}

/* Header Title */
.header-title {
    text-align: center;
    margin-bottom: 15px;
    padding: 16px;
    background: linear-gradient(135deg, #0c0074 0%, #06003a 100%);
    border-radius: 12px;
    color: white;
}

.header-title h1 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 4px;
}

.header-title p {
    font-size: 14px;
    opacity: 0.9;
    margin: 0;
}

/* การ์ดใหม่ */
.emulator-main {
    display: flex;
    align-items: center;
    gap: 8px;
}

.emulator-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.emulator-icon img {
    width: 100%;
    height: 100%;
    padding: 2px;
    object-fit: contain;
    border-radius: 4px;
}
/*สีอุปกรณ์รองรับ*/
/* Platform Tags */
.platform-tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    margin-left: 6px;
    color: white;
}

.platform-tag.android {
    background-color: #34C759; /* สีเขียว Android */
}

.platform-tag.ios {
    background-color: #79a5c4; /* สีฟ้า iOS */
}

.platform-tag.pc {
    background-color: #55099d; /* สีแดง PC */
}