:root {
    /* Varsayılan: DARK MODE */
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --bg-color: #0f172a;
    --glass-bg: rgba(30, 41, 59, 0.85);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border: #334155;
    --danger: #ef4444;
    --input-bg: #1e293b;
    --selected-border: #38bdf8;
}

body.light-mode {
    --primary: #4f46e5;
    --primary-dark: #4338ca;
    --bg-color: #f3f4f6;
    --glass-bg: rgba(255, 255, 255, 0.9);
    --text-main: #111827;
    --text-muted: #6b7280;
    --border: #e5e7eb;
    --danger: #ef4444;
    --input-bg: #ffffff;
    --selected-border: #2563eb;
}

* { box-sizing: border-box; transition: background 0.3s, color 0.3s; }
body { font-family: 'Plus Jakarta Sans', sans-serif; background: var(--bg-color); margin: 0; color: var(--text-main); min-height: 100vh; overflow-x: hidden; }

/* Background */
.bg-shape { position: fixed; border-radius: 50%; filter: blur(90px); z-index: -1; }
.shape-1 { width: 400px; height: 400px; background: #312e81; top: -10%; left: -10%; animation: float 8s infinite alternate; }
.shape-2 { width: 350px; height: 350px; background: #831843; bottom: -10%; right: -10%; animation: float 8s infinite alternate-reverse; }
body.light-mode .shape-1 { background: #c7d2fe; }
body.light-mode .shape-2 { background: #fbcfe8; }
@keyframes float { to { transform: translate(30px, 40px); } }

/* Navbar */
.navbar { display: flex; justify-content: space-between; padding: 20px 5%; align-items: center; }
.nav-actions { display: flex; align-items: center; gap: 10px; /* Buton ile Güneş simgesi arasındaki boşluk */ }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 20px; }
.logo-icon { width: 35px; height: 35px; background: var(--primary); color: white; border-radius: 10px; display: flex; justify-content: center; align-items: center; }
.icon-btn { background: transparent; border: 1px solid var(--border); color: var(--text-main); padding: 8px; border-radius: 8px; cursor: pointer; }
.icon-btn:hover { background: var(--border); }

/* Main */
.main-wrapper { max-width: 650px; margin: 40px auto; padding: 0 20px; }
.glass-container { background: var(--glass-bg); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border: 1px solid var(--border); border-radius: 24px; padding: 40px; text-align: center; box-shadow: 0 20px 40px -10px rgba(0,0,0,0.2); }

h1 { margin: 15px 0; font-size: 32px; line-height: 1.2; }
.gradient-text { background: linear-gradient(to right, var(--primary), #ec4899); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }

/* Upload Area */
.upload-area { margin-top: 30px; border: 2px dashed var(--border); border-radius: 16px; padding: 40px; cursor: pointer; transition: 0.2s; background: rgba(255,255,255,0.02); }
.upload-area:hover { border-color: var(--primary); transform: translateY(-2px); }
.icon-stack { font-size: 40px; color: var(--primary); margin-bottom: 15px; }
.support-text { font-size: 13px; color: var(--text-muted); margin-bottom: 20px; }
.browse-btn { background: var(--text-main); color: var(--bg-color); border: none; padding: 10px 24px; border-radius: 8px; font-weight: 600; cursor: pointer; pointer-events: none; }

/* Galeri Grid */
.image-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 12px; margin-bottom: 20px; max-height: 300px; overflow-y: auto; padding-right: 5px; }
.image-grid::-webkit-scrollbar { width: 6px; }
.image-grid::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; }

.thumb-card { position: relative; height: 100px; border-radius: 12px; overflow: hidden; border: 2px solid transparent; cursor: pointer; transition: 0.2s; background: var(--input-bg); }
.thumb-card img { width: 100%; height: 100%; object-fit: cover; opacity: 0.8; transition: 0.2s; }
.thumb-card:hover img { opacity: 1; }
.thumb-card.selected { border-color: var(--selected-border); box-shadow: 0 0 10px var(--selected-border); }
.thumb-card.selected img { opacity: 1; }

.remove-icon { position: absolute; top: 5px; right: 5px; background: rgba(239, 68, 68, 0.9); color: white; width: 22px; height: 22px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; cursor: pointer; z-index: 10; transition: 0.2s; }
.remove-icon:hover { transform: scale(1.1); background: red; }

.file-summary { display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: var(--text-muted); border-bottom: 1px solid var(--border); padding-bottom: 15px; margin-bottom: 20px; }
.text-btn { background: none; border: none; color: var(--danger); cursor: pointer; font-size: 12px; font-weight: 600; }

/* Controls */
.controls-wrapper { text-align: left; }
.selection-info { font-size: 13px; color: var(--selected-border); margin-bottom: 10px; display: flex; align-items: center; gap: 8px; font-weight: 600; }

/* Resize Accordion */
.resize-wrapper { border: 1px solid var(--border); border-radius: 12px; background: rgba(0,0,0,0.1); margin-bottom: 20px; overflow: hidden; }
.resize-header { display: flex; justify-content: space-between; align-items: center; padding: 15px; cursor: pointer; background: var(--input-bg); transition: 0.2s; }
.resize-header:hover { background: rgba(255,255,255,0.05); }
.header-left { display: flex; align-items: center; gap: 10px; }
.toggle-label { cursor: pointer; font-weight: 600; font-size: 13px; user-select: none; }
input[type="checkbox"] { width: 16px; height: 16px; cursor: pointer; accent-color: var(--primary); }
.resize-body { padding: 0 15px; max-height: 0; overflow: hidden; transition: max-height 0.3s ease-out, padding 0.3s ease; opacity: 0; }
.resize-body.open { max-height: 200px; padding: 15px; opacity: 1; border-top: 1px solid var(--border); }

.resize-inputs { display: flex; align-items: center; gap: 10px; }
.input-group { flex: 1; }
.input-group label { display: block; font-size: 11px; margin-bottom: 5px; color: var(--text-muted); font-weight: 600; }
.input-group input { width: 100%; padding: 10px; background: var(--bg-color); border: 1px solid var(--border); color: var(--text-main); border-radius: 8px; font-size: 14px; outline: none; }
.resize-hint { font-size: 11px; color: var(--text-muted); margin-top: 10px; text-align: center; }

.lock-btn { background: var(--bg-color); border: 1px solid var(--border); color: var(--text-muted); width: 36px; height: 36px; border-radius: 8px; display: flex; align-items: center; justify-content: center; cursor: pointer; margin-top: 15px; transition: 0.2s; }
.lock-btn.active { background: var(--primary); color: white; border-color: var(--primary); }

/* Format Select */
.section-title { font-size: 12px; font-weight: 700; color: var(--text-muted); display: block; margin-bottom: 10px; letter-spacing: 0.5px; text-transform: uppercase;}
.setting-box select { width: 100%; padding: 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--input-bg); color: var(--text-main); outline: none; margin-bottom: 20px; }

/* Buttons */
.action-buttons { display: flex; gap: 10px; }
.secondary-btn { flex: 1; padding: 14px; border-radius: 10px; border: 2px solid var(--border); background: transparent; color: var(--text-main); font-weight: 600; cursor: pointer; display: flex; justify-content: center; align-items: center; gap: 8px; }
.secondary-btn:hover { background: var(--border); }
.primary-btn { flex: 2; padding: 14px; border-radius: 10px; border: none; background: var(--primary); color: white; font-weight: 600; cursor: pointer; display: flex; justify-content: center; align-items: center; gap: 8px; }
.primary-btn:hover { background: var(--primary-dark); }

/* Loading & Recent */
.loading-state { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 15px; color: var(--primary); font-weight: 600; font-size: 14px; }
.spinner { width: 18px; height: 18px; border: 3px solid rgba(0,0,0,0.1); border-top-color: var(--primary); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.recent-area { margin-top: 40px; text-align: left; border-top: 1px solid var(--border); padding-top: 20px; }
.recent-area h3 { font-size: 14px; color: var(--text-muted); margin-bottom: 15px; }
#recent-list { list-style: none; padding: 0; }
#recent-list li { font-size: 13px; padding: 10px 0; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; }
.badge-type { background: var(--primary); color: white; padding: 3px 8px; border-radius: 6px; font-size: 10px; font-weight: 700; }

/* FAQ & SEO & Ads */
.faq-section { margin-top: 60px; text-align: left; max-width: 650px; margin-left: auto; margin-right: auto; }
.faq-section h2 { font-size: 20px; text-align: center; margin-bottom: 25px; }
.faq-item { background: var(--input-bg); border-radius: 12px; margin-bottom: 12px; border: 1px solid var(--border); overflow: hidden; }
.faq-question { padding: 18px; font-weight: 600; cursor: pointer; display: flex; justify-content: space-between; font-size: 14px; }
.faq-answer { padding: 0 18px 18px 18px; color: var(--text-muted); font-size: 14px; line-height: 1.6; display: none; }
footer { margin-top: 60px; color: var(--text-muted); font-size: 12px; text-align: center; padding-bottom: 30px; }

.ad-container { width: 100%; max-width: 728px; margin: 20px auto; text-align: center; }
.ad-label { display: block; font-size: 10px; color: var(--text-muted); margin-bottom: 5px; text-transform: uppercase; letter-spacing: 1px; }
.ad-placeholder { background: rgba(0,0,0,0.05); border: 1px dashed var(--border); color: var(--text-muted); padding: 20px; border-radius: 8px; font-size: 14px; display: flex; align-items: center; justify-content: center; min-height: 90px; }

.seo-content { margin-top: 60px; padding: 30px; background: var(--input-bg); border-radius: 16px; border: 1px solid var(--border); text-align: left; }
.seo-content h3 { font-size: 18px; margin-bottom: 15px; color: var(--text-main); }
.seo-content p { font-size: 14px; color: var(--text-muted); line-height: 1.6; margin-bottom: 15px; }
.keywords-cloud { margin-top: 20px; font-size: 12px; color: var(--primary); font-weight: 600; text-align: center; opacity: 0.8; }
/* --- QUALITY SLIDER --- */
.quality-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

#quality-value {
    font-size: 12px;
    font-weight: 700;
    color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
    padding: 2px 8px;
    border-radius: 6px;
}

.quality-range {
    -webkit-appearance: none;
    width: 100%;
    height: 6px;
    background: var(--border);
    border-radius: 5px;
    outline: none;
    cursor: pointer;
}

.quality-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: var(--primary);
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid var(--input-bg);
    box-shadow: 0 0 5px rgba(0,0,0,0.2);
    transition: transform 0.1s;
}

.quality-range::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}

.quality-range::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: var(--primary);
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid var(--input-bg);
}

/* --- DRAG & DROP --- */
.sortable-ghost {
    opacity: 0.4;
    background: var(--primary);
    border: 2px dashed var(--text-main);
}

.thumb-card {
    cursor: grab; /* Tutulabilir işareti */
}

.thumb-card:active {
    cursor: grabbing; /* Tutunca el işareti sıkılsın */
}

/* --- BUY ME A COFFEE BUTTON --- */
.coffee-btn {
    text-decoration: none;
    background: #FFDD00; /* Klasik BMC Sarısı */
    color: #000000;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-right: 12px;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 10px rgba(255, 221, 0, 0.2);
}

.coffee-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(255, 221, 0, 0.4);
    background: #ffea00;
}

/* Mobilde sadece ikon görünsün (Yer kaplamasın) */
@media (max-width: 768px) {
    .coffee-text {
        display: none;
    }
    .coffee-btn {
        padding: 8px 10px;
        border-radius: 8px;
    }
}

/* --- RESPONSIVE MOBIL (Fix Sürüm) --- */
@media (max-width: 768px) {
    .main-wrapper { margin: 10px auto; padding: 0 10px; }
    .glass-container { padding: 20px 15px; }
    h1 { font-size: 24px; margin-top: 5px; }
    .setting-box { width: 100%; max-width: 100%; overflow: hidden; }
    .setting-box select { width: 100%; font-size: 13px; padding: 12px 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    
    .resize-inputs { display: flex; flex-direction: row; align-items: flex-end; gap: 8px; }
    .input-group { flex: 1; min-width: 0; }
    .lock-btn { width: 40px !important; height: 40px !important; flex-shrink: 0; margin-top: 0; margin-bottom: 2px; transform: none; border-radius: 8px; }
    
    .action-buttons { flex-direction: column; gap: 10px; }
    .secondary-btn, .primary-btn { width: 100%; padding: 15px; }
    .upload-area { padding: 20px; }
    .image-grid { grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 8px; }
    .thumb-card { height: 80px; }
}