/* =================================================
   GIAO DIỆN TỐI GIẢN CỰC HẠN - LIÊN QUÂN MOBILE
   ================================================= */

:root {
    --primary: #3b82f6;
    --primary-dark: #1e40af;
    --success: #10b981;
    --bg-dark: #1a1a1a00;
    --text-muted: #64748b;
    --border: #e2e8f0;
}

/* Hệ thống Label & Input */
label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    margin-bottom: 15px;
}

input[type="text"], select {
    width: 100%;
    padding: 8px 12px;
    margin-top: 5px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 13px;
    outline: none;
    transition: border 0.2s;
    background: #f8fafc;
}

input[type="text"]:focus, select:focus {
    border-color: var(--primary);
    background: #fff;
}

/* Khu vực tải ảnh - Upload Card */
.upload-card {
    max-width: 100%;
    margin: 10px 0 20px;
    padding: 20px;
    border: 2px dashed var(--primary);
    background: #eff6ff;
    border-radius: 8px;
    text-align: center;
    transition: 0.3s;
}

.upload-icon { font-size: 28px; color: var(--primary); margin-bottom: 8px; }
.upload-card h3 { font-size: 14px; margin: 5px 0; color: var(--primary-dark); }

/* Hệ thống nút bấm */
.btn-select, .btn-primary, .btn-secondary, #createBtn, #saveBtn {
    display: inline-block;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    border-radius: 6px;
    text-align: center;
    transition: 0.2s;
}

.btn-select, .btn-primary, #createBtn { background: var(--primary); color: #fff; width: 100%; }
#saveBtn { background: var(--success); color: #fff; width: 100%; margin-top: 10px; }
.btn-secondary { background: #f1f5f9; color: #475569; }

.btn-primary:hover, #createBtn:hover { background: var(--primary-dark); }

/* Switch Toggle (Viền tên vàng & Highlight) */
.switch-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding: 8px 0;
    border-bottom: 1px solid #f1f5f9;
}

.switch-line span { font-size: 13px; color: #475569; font-weight: 500; }

.switch { position: relative; display: inline-block; width: 34px; height: 20px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
    position: absolute; cursor: pointer; inset: 0;
    background-color: #cbd5e1; transition: .3s; border-radius: 20px;
}
.slider:before {
    position: absolute; content: ""; height: 14px; width: 14px;
    left: 3px; bottom: 3px; background-color: white; transition: .3s; border-radius: 50%;
}
input:checked + .slider { background-color: var(--primary); }
input:checked + .slider:before { transform: translateX(14px); }

/* Modal cắt ảnh */
.crop-modal {
    position: fixed; inset: 0; background: rgba(0,0,0,0.85);
    display: flex; align-items: center; justify-content: center; z-index: 1000;
    padding: 15px;
}
.modal-content { 
    background: #fff; width: 100%; max-width: 400px; 
    border-radius: 12px; overflow: hidden; box-shadow: 0 25px 50px -12px rgba(0,0,0,0.5);
}
.modal-header {
    padding: 12px 15px; display: flex; justify-content: space-between;
    border-bottom: 1px solid #eee; align-items: center; background: #fff;
}
.modal-header h4 { font-size: 14px; margin: 0; font-weight: 700; color: #1e293b; }
.close-modal { 
    background: #f1f5f9; color: #64748b; border: none; 
    width: 24px; height: 24px; border-radius: 50%; cursor: pointer; line-height: 24px;
}

.modal-body { padding: 0; background: #000; line-height: 0; }
.img-container { max-height: 60vh; overflow: hidden; }

.modal-footer { padding: 12px 15px; display: flex; justify-content: flex-end; gap: 8px; background: #fff; }

/* Preview sau khi Crop */
.result-preview { display: flex; align-items: center; gap: 12px; justify-content: center; }
.result-preview img { width: 50px; height: 65px; border-radius: 4px; border: 2px solid var(--primary); object-fit: cover; }
.result-preview span { font-size: 12px; color: var(--success); font-weight: 600; }
.re-upload { font-size: 11px; color: var(--primary); text-decoration: underline; cursor: pointer; }

/* Toast Notification */
.toast {
    position: fixed; top: 20px; left: 50%; transform: translateX(-50%);
    background: #334155; color: #fff; padding: 10px 20px;
    border-radius: 50px; font-size: 12px; font-weight: 500;
    transition: 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    opacity: 0; pointer-events: none; z-index: 2000;
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.2);
}
.toast.show { opacity: 1; top: 40px; }

/* Khu vực Canvas Preview */
.tao-preview {
    min-height: 400px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: var(--bg-dark);
    border-radius: 12px;
    margin-top: 25px;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

#previewImage {
    max-width: 100%;
    height: auto;
    border: 1px solid #334155;
    border-radius: 8px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
}

/* Loading Spinner */
.loading-overlay {
    position: absolute; inset: 0; background: rgba(0,0,0,0.7);
    display: flex; justify-content: center; align-items: center; z-index: 10;
}
.spinner {
    width: 30px; height: 30px; border: 3px solid rgba(255,255,255,0.3);
    border-radius: 50%; border-top-color: #fff;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }