/**
 * Settings Modal Styles for Catch The Gifts Game
 * ABC Website (abcwebsite.com.vn)
 */

.settings-modal-card {
    font-family: var(--font-family, 'Be Vietnam Pro', 'Plus Jakarta Sans', system-ui, sans-serif);
    background: #ffffff;
    color: #0f172a;
    width: 100%;
    max-width: 660px;
    height: min(90vh, 640px);
    max-height: 90vh;
    border-radius: 24px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.45);
    position: relative;
    overflow: hidden;
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.settings-modal-card input,
.settings-modal-card select,
.settings-modal-card button {
    font-family: inherit;
}

:is(.catch-modal, .game-modal).is-active .settings-modal-card {
    transform: scale(1) translateY(0);
}

/* Header Modal */
.settings-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 22px;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
    flex-shrink: 0;
}

.settings-header h3 {
    font-size: 17px;
    font-weight: 800;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 8px;
}

.settings-header p {
    font-size: 11.5px;
    color: #64748b;
    margin-top: 2px;
}

/* Tab Bar Navigation (Cố định, không bao giờ bị đè hay co lại) */
.settings-tabs-nav {
    display: flex;
    background: #f1f5f9;
    border-bottom: 1px solid #e2e8f0;
    overflow-x: auto;
    scrollbar-width: none;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    z-index: 10;
}
.settings-tabs-nav::-webkit-scrollbar {
    display: none;
}

.settings-tab-btn {
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 700;
    color: #64748b;
    border: none;
    background: none;
    cursor: pointer;
    white-space: nowrap;
    border-bottom: 2.5px solid transparent;
    transition: color 0.2s, border-color 0.2s;
}

.settings-tab-btn:hover {
    color: #0f172a;
}

.settings-tab-btn.is-active {
    color: #f97316;
    border-bottom-color: #f97316;
    background: #ffffff;
}

/* Body Modal (Vùng cuộn độc lập, min-height: 0 để flexbox không đẩy hỏng thanh tab) */
.settings-body {
    padding: 18px 22px;
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1 1 0%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 #f8fafc;
}

.settings-body::-webkit-scrollbar {
    width: 6px;
}
.settings-body::-webkit-scrollbar-track {
    background: #f8fafc;
}
.settings-body::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 999px;
}
.settings-body::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.settings-tab-pane {
    display: none;
    flex-direction: column;
    gap: 16px;
}

.settings-tab-pane.is-active {
    display: flex;
}

.settings-section-title {
    font-size: 13.5px;
    font-weight: 700;
    color: #334155;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Grid cài đặt */
.settings-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.settings-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.settings-field label {
    font-size: 12.5px;
    font-weight: 600;
    color: #475569;
}

.settings-field input[type="text"],
.settings-field input[type="number"],
.settings-field select {
    height: 38px;
    padding: 0 12px;
    border: 1.5px solid #cbd5e1;
    border-radius: 8px;
    font-size: 13.5px;
    color: #0f172a;
    background: #ffffff;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.settings-field input:focus,
.settings-field select:focus {
    border-color: #f97316;
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.15);
}

/* Danh sách vật phẩm rơi */
.settings-items-wrap {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.item-config-row {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: border-color 0.2s;
}

.item-config-row:hover {
    border-color: #cbd5e1;
}

.item-row-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.item-row-title-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.item-badge {
    font-size: 11px;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 6px;
}
.item-badge-prize { background: #dcfce7; color: #15803d; }
.item-badge-trap { background: #fee2e2; color: #b91c1c; }
.item-badge-powerup { background: #e0f2fe; color: #0369a1; }

.inp-item-name {
    flex: 1;
    max-width: 240px;
    height: 32px;
    padding: 0 10px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
}

.btn-remove-item {
    background: none;
    border: none;
    font-size: 22px;
    color: #94a3b8;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}
.btn-remove-item:hover {
    color: #ef4444;
}

.item-row-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.item-row-icon-row {
    display: flex;
    gap: 12px;
    background: #ffffff;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    padding: 8px 12px;
}

.btn-add-item-action {
    width: 100%;
    padding: 10px;
    border: 2px dashed #cbd5e1;
    border-radius: 10px;
    background: #f8fafc;
    color: #0f75bd;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}

.btn-add-item-action:hover {
    background: #e0f2fe;
    border-color: #0f75bd;
}

/* Thẻ lật trúng thưởng */
.card-config-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.card-config-num {
    font-size: 12px;
    font-weight: 800;
    color: #d97706;
}

/* Footer Modal */
.settings-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 22px;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
    flex-shrink: 0;
}

.settings-footer-left,
.settings-footer-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-tool-secondary {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: #475569;
    padding: 7px 12px;
    border-radius: 8px;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}

.btn-tool-secondary:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
}

.btn-tool-danger {
    color: #dc2626;
    border-color: #fecaca;
}
.btn-tool-danger:hover {
    background: #fef2f2;
    border-color: #ef4444;
}

.btn-tool-primary {
    background: #f97316;
    border: 1px solid #ea580c;
    color: #ffffff;
    padding: 7px 18px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-tool-primary:hover {
    background: #ea580c;
}

@media (max-width: 600px) {
    .settings-grid-2 {
        grid-template-columns: 1fr;
    }
    .item-row-grid {
        grid-template-columns: 1fr 1fr;
    }
    .item-row-icon-row {
        flex-direction: column;
    }
    .settings-footer {
        flex-direction: column;
        gap: 12px;
    }
    .settings-footer-left,
    .settings-footer-right {
        width: 100%;
        justify-content: space-between;
    }
}
