/* =========================
   MODAL DÜZENİ (SIFIR HATA VERSİYONU)
   ========================= */

/* 1. Dış Çerçeve (Perde) */
.modal-overlay {
    position: fixed !important;
    top: 0 !important; left: 0 !important;
    width: 100vw !important; height: 100vh !important;
    background: rgba(0, 0, 0, 0.85) !important;
    backdrop-filter: blur(8px);
    z-index: 99999 !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    padding: 20px;
    opacity: 0; visibility: hidden; pointer-events: none;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1 !important; visibility: visible !important; pointer-events: all !important;
}

/* 2. Modal Kutusu */
.modal-content {
    background: #1e293b;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 20px;
    padding: 30px;
    width: 100%;
    max-width: 500px;
    position: relative;
    /* 🔥 EN ÖNEMLİ KISIM: İÇERİKLERİ ALT ALTA DİZ 🔥 */
    display: flex !important;
    flex-direction: column !important; 
    gap: 20px !important;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.5);
    transform: translateY(20px); transition: 0.3s;
}

.modal-overlay.active .modal-content { transform: translateY(0); }

/* Form Düzeni */
#upload-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 100%;
}

/* Form Elemanları */
.form-group { width: 100%; text-align: left; margin: 0; }
.form-group label { display: block; color: #cbd5e1; margin-bottom: 8px; font-size: 0.9rem; font-weight: 600; }

.form-group input, .form-group textarea, .form-group select {
    width: 100%; padding: 12px 15px;
    background: #0f172a; border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px; color: #fff; font-size: 0.95rem;
    box-sizing: border-box; /* Taşmayı önler */
}
.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
    border-color: #ffd700; outline: none;
}

/* Yan Yana Duranlar */
.form-row {
    display: flex;
    gap: 15px;
    width: 100%;
    align-items: flex-end;
}

/* Kapatma Butonu */
.close-modal {
    position: absolute; top: 15px; right: 15px;
    width: 30px; height: 30px;
    background: rgba(255,255,255,0.1); border: none; border-radius: 50%;
    color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.close-modal:hover { background: #ef4444; }

/* Dosya Yükleme */
.file-upload-wrapper {
    position: relative; width: 100%; height: 70px;
    background: rgba(255,255,255,0.03); border: 2px dashed rgba(255,255,255,0.2);
    border-radius: 12px; display: flex; justify-content: center; align-items: center;
    cursor: pointer;
}
.file-upload-wrapper input[type="file"] {
    position: absolute; width: 100%; height: 100%; opacity: 0; cursor: pointer;
}
.file-upload-ui { color: #94a3b8; display: flex; flex-direction: column; align-items: center; }

/* Önizleme */
.preview-box {
    width: 100%; height: 150px; background: #0b0d10; border-radius: 10px;
    display: flex; justify-content: center; align-items: center; overflow: hidden;
    margin-bottom: 0; /* Gap hallediyor */
}
.preview-box img { width: 100%; height: 100%; object-fit: cover; }
.preview-box.hidden { display: none; } /* Resim yoksa gizle */
.preview-box.has-image { display: flex; border: 2px solid #ffd700; }

/* Özel Select & Toggle */
.custom-select-wrapper { position: relative; width: 100%; }
.select-icon { position: absolute; right: 15px; top: 50%; transform: translateY(-50%); color: #94a3b8; pointer-events: none;}
.custom-select-wrapper select { appearance: none; }

.premium-toggle { display: block; cursor: pointer; width: 100%; }
.premium-toggle input { display: none; }
.toggle-ui {
    display: flex; background: #0f172a; border: 1px solid rgba(255,255,255,0.15);
    border-radius: 10px; padding: 4px; height: 45px; align-items: center; position: relative;
}
.toggle-ui span { flex: 1; text-align: center; font-size: 0.85rem; font-weight: 600; z-index: 2; color: #64748b; }
.toggle-ui::before {
    content: ''; position: absolute; width: 50%; height: 80%; top: 10%; left: 4px;
    background: #334155; border-radius: 6px; transition: 0.3s;
}
.premium-toggle input:not(:checked) + .toggle-ui .status-free { color: #fff; }
.premium-toggle input:checked + .toggle-ui::before { left: calc(50% - 4px); background: #ffd700; }
.premium-toggle input:checked + .toggle-ui .status-premium { color: #000; }

/* Kaydet Butonu */
.save-btn {
    width: 100%; padding: 15px; background: #ffd700; color: #000; border: none;
    border-radius: 12px; font-weight: 800; cursor: pointer; display: flex;
    justify-content: center; align-items: center; gap: 10px;
}
.save-btn:hover { background: #ffed4a; transform: translateY(-2px); }

/* Mobil Ayarı */
@media (max-width: 768px) {
    .form-row { flex-direction: column; gap: 15px; }
}