/* ============================================================
   TOMARA ADMIN PANEL — Styles
   ============================================================ */
:root {
    --sidebar-w: 260px;
    --brand:     #8B2332;
    --brand-dk:  #6D1A26;
    --green:     #1A5C40;
    --gold:      #C9A227;
    --bg:        #F0F2F5;
    --white:     #FFFFFF;
    --dark:      #1E2027;
    --sidebar-bg:#1E2027;
    --text:      #1A1A1A;
    --muted:     #6B7280;
    --border:    #E5E7EB;
    --danger:    #DC2626;
    --success:   #16A34A;
    --r:         10px;
    --sh:        0 2px 12px rgba(0,0,0,.08);
    --sh-lg:     0 8px 32px rgba(0,0,0,.14);
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }
body { font-family: 'Poppins', sans-serif; background: var(--bg); color: var(--text); overflow-x: hidden; }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }
img { max-width: 100%; display: block; }

/* ============================================================
   LOGIN SCREEN
   ============================================================ */
.login-screen {
    min-height: 100vh; display: flex;
    align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--dark) 0%, #2d1a20 50%, #0f2d1e 100%);
    padding: 2rem;
}
.login-card {
    background: var(--white); border-radius: 20px;
    padding: 3rem 2.5rem; width: 100%; max-width: 420px;
    box-shadow: var(--sh-lg); text-align: center;
}
.login-logo { margin-bottom: 1.5rem; }
.login-logo img { height: 56px; margin: 0 auto; }
.login-card h1 { font-size: 1.7rem; font-weight: 700; margin-bottom: .5rem; }
.login-card > p { color: var(--muted); margin-bottom: 2rem; font-size: .95rem; }

.login-field {
    display: flex; align-items: center; gap: .5rem;
    border: 2px solid var(--border); border-radius: var(--r);
    padding: .75rem 1rem; margin-bottom: 1rem;
    transition: border-color .2s;
}
.login-field:focus-within { border-color: var(--brand); }
.login-field i { color: var(--muted); }
.login-field input {
    flex: 1; border: none; outline: none;
    font-family: inherit; font-size: .95rem;
}
.login-field button {
    background: none; border: none; cursor: pointer;
    color: var(--muted); padding: 0; transition: color .2s;
}
.login-field button:hover { color: var(--brand); }

.login-error {
    color: var(--danger); font-size: .85rem;
    margin-bottom: .8rem; display: none;
}
.login-error.show { display: block; }

.login-btn {
    width: 100%; padding: .9rem; border: none; border-radius: var(--r);
    background: linear-gradient(135deg, var(--brand), var(--green));
    color: white; font-family: inherit; font-size: 1rem; font-weight: 700;
    cursor: pointer; transition: opacity .2s, transform .2s;
}
.login-btn:hover { opacity: .92; transform: translateY(-2px); }
.login-hint { margin-top: 1.5rem; font-size: .8rem; color: var(--muted); }
.login-hint code { background: var(--bg); padding: .1rem .4rem; border-radius: 4px; font-family: monospace; }

/* ============================================================
   ADMIN WRAPPER
   ============================================================ */
.admin-wrapper { display: flex; min-height: 100vh; }
.admin-wrapper.hidden, .login-screen.hidden { display: none; }

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
    width: var(--sidebar-w); background: var(--sidebar-bg);
    color: white; display: flex; flex-direction: column;
    position: fixed; top: 0; left: 0; bottom: 0; z-index: 100;
    transition: transform .3s ease;
    overflow-y: auto;
}
.sidebar-logo {
    display: flex; align-items: center; gap: .9rem;
    padding: 1.5rem 1.4rem; border-bottom: 1px solid rgba(255,255,255,.1);
    font-size: 1rem; font-weight: 700;
}
.sidebar-logo img { height: 36px; filter: brightness(0) invert(1); }
.sidebar-logo span { color: rgba(255,255,255,.9); }

.sidebar-nav { flex: 1; padding: 1rem 0; }
.nav-item {
    display: flex; align-items: center; gap: .85rem;
    padding: .85rem 1.4rem; font-size: .9rem; font-weight: 500;
    color: rgba(255,255,255,.65); transition: all .2s;
    border-left: 3px solid transparent;
}
.nav-item:hover { color: white; background: rgba(255,255,255,.07); }
.nav-item.active {
    color: white; background: rgba(139,35,50,.35);
    border-left-color: var(--brand);
}
.nav-item i { width: 18px; text-align: center; font-size: .95rem; }

.sidebar-tools {
    padding: 1.2rem; border-top: 1px solid rgba(255,255,255,.1);
    display: flex; flex-direction: column; gap: .5rem;
}
.tool-btn {
    display: flex; align-items: center; justify-content: center; gap: .5rem;
    padding: .65rem; border-radius: var(--r);
    background: rgba(255,255,255,.1); color: rgba(255,255,255,.8);
    border: none; cursor: pointer; font-family: inherit;
    font-size: .82rem; font-weight: 500; transition: all .2s;
}
.tool-btn:hover { background: rgba(255,255,255,.18); color: white; }
.tool-btn.danger:hover { background: rgba(220,38,38,.35); color: #fca5a5; }

/* ============================================================
   MAIN
   ============================================================ */
.admin-main {
    flex: 1; margin-left: var(--sidebar-w);
    display: flex; flex-direction: column; min-height: 100vh;
}

.admin-header {
    background: var(--white); border-bottom: 1px solid var(--border);
    padding: 1rem 1.8rem; display: flex;
    align-items: center; justify-content: space-between;
    position: sticky; top: 0; z-index: 50; box-shadow: var(--sh);
}
.header-left { display: flex; align-items: center; gap: 1rem; }
.sidebar-toggle {
    display: none; background: none; border: none; cursor: pointer;
    font-size: 1.2rem; color: var(--muted);
}
.admin-header h2 { font-size: 1.15rem; font-weight: 700; }
.header-right { display: flex; align-items: center; gap: .8rem; }
.view-site-btn {
    display: flex; align-items: center; gap: .5rem;
    padding: .55rem 1.1rem; border-radius: var(--r);
    background: var(--bg); font-size: .85rem; font-weight: 600;
    color: var(--muted); transition: all .2s;
}
.view-site-btn:hover { background: var(--brand); color: white; }
.logout-btn {
    display: flex; align-items: center; gap: .5rem;
    padding: .55rem 1.1rem; border-radius: var(--r);
    border: 1px solid var(--border); background: none;
    cursor: pointer; font-family: inherit; font-size: .85rem;
    font-weight: 600; color: var(--muted); transition: all .2s;
}
.logout-btn:hover { border-color: var(--danger); color: var(--danger); }

/* ============================================================
   CONTENT
   ============================================================ */
.admin-content { flex: 1; padding: 2rem 1.8rem; }

.content-section { display: none; }
.content-section.active { display: block; }

.section-intro {
    background: var(--white); border-radius: var(--r);
    padding: 1.2rem 1.5rem; margin-bottom: 1.8rem;
    border-left: 4px solid var(--brand);
    display: flex; align-items: flex-start; gap: 1rem;
}
.section-intro i { color: var(--brand); font-size: 1.3rem; margin-top: .1rem; }
.section-intro p { font-size: .9rem; color: var(--muted); line-height: 1.6; }
.section-intro strong { color: var(--text); }

.form-card {
    background: var(--white); border-radius: var(--r);
    padding: 1.8rem; margin-bottom: 1.5rem;
    box-shadow: var(--sh);
}
.form-card h3 {
    font-size: 1rem; font-weight: 700; margin-bottom: 1.4rem;
    padding-bottom: .8rem; border-bottom: 1px solid var(--border);
    color: var(--brand);
}
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; }
.form-grid.single { grid-template-columns: 1fr; }

.field-group { margin-bottom: 0; }
.field-group label {
    display: block; font-size: .82rem; font-weight: 600;
    color: var(--muted); margin-bottom: .4rem; text-transform: uppercase;
    letter-spacing: .5px;
}
.field-group input,
.field-group select,
.field-group textarea {
    width: 100%; padding: .75rem .95rem;
    border: 1.5px solid var(--border); border-radius: 8px;
    font-family: inherit; font-size: .92rem; color: var(--text);
    transition: border-color .2s, box-shadow .2s;
    background: white;
}
.field-group input:focus,
.field-group select:focus,
.field-group textarea:focus {
    outline: none; border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(139,35,50,.1);
}
.field-group textarea { resize: vertical; min-height: 90px; }

/* Image field */
.image-field { display: flex; gap: 1rem; align-items: flex-start; }
.image-preview {
    width: 80px; height: 60px; border-radius: 8px;
    object-fit: cover; border: 2px solid var(--border);
    flex-shrink: 0; background: var(--bg);
}
.image-input-wrap { flex: 1; }
.image-input-wrap input { margin-bottom: .4rem; }
.img-hint { font-size: .75rem; color: var(--muted); }

/* Stats grid */
.stats-editor-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.stat-editor-card {
    border: 1.5px solid var(--border); border-radius: 8px;
    padding: 1.1rem; background: var(--bg);
}
.stat-editor-card h4 { font-size: .82rem; font-weight: 700; color: var(--muted); margin-bottom: .8rem; text-transform: uppercase; letter-spacing: .5px; }
.stat-editor-card .field-group { margin-bottom: .6rem; }
.stat-editor-card .field-group:last-child { margin-bottom: 0; }

/* ============================================================
   FOOTER BAR
   ============================================================ */
.admin-footer-bar {
    background: var(--white); border-top: 1px solid var(--border);
    padding: 1rem 1.8rem; display: flex;
    align-items: center; gap: 1.2rem;
    position: sticky; bottom: 0; z-index: 50;
}
.save-btn {
    display: flex; align-items: center; gap: .6rem;
    padding: .75rem 2rem; border: none; border-radius: var(--r);
    background: linear-gradient(135deg, var(--brand), var(--green));
    color: white; font-family: inherit; font-size: .95rem;
    font-weight: 700; cursor: pointer; transition: opacity .2s, transform .2s;
}
.save-btn:hover { opacity: .9; transform: translateY(-1px); }
.save-btn:active { transform: translateY(0); }
#saveStatus {
    font-size: .9rem; font-weight: 600;
    transition: opacity .4s;
}
#saveStatus.success { color: var(--success); }
#saveStatus.error   { color: var(--danger); }

/* ============================================================
   CONFIRM MODAL
   ============================================================ */
.confirm-overlay {
    position: fixed; inset: 0; z-index: 9999;
    background: rgba(0,0,0,.6);
    display: none; align-items: center; justify-content: center;
    padding: 1.5rem;
}
.confirm-overlay.open { display: flex; }
.confirm-box {
    background: var(--white); border-radius: 16px;
    padding: 2.5rem; max-width: 400px; width: 100%;
    text-align: center; box-shadow: var(--sh-lg);
}
.confirm-icon { font-size: 3rem; color: var(--gold); margin-bottom: 1rem; }
.confirm-box h3 { font-size: 1.3rem; margin-bottom: .6rem; }
.confirm-box p { color: var(--muted); margin-bottom: 1.8rem; font-size: .92rem; }
.confirm-btns { display: flex; gap: .8rem; justify-content: center; }
.confirm-btns button {
    padding: .7rem 1.8rem; border-radius: 8px; border: none;
    font-family: inherit; font-size: .9rem; font-weight: 700;
    cursor: pointer; transition: all .2s;
}
#confirmCancel { background: var(--bg); color: var(--muted); }
#confirmCancel:hover { background: var(--border); }
#confirmOk.danger { background: var(--danger); color: white; }
#confirmOk.danger:hover { background: #b91c1c; }

/* ============================================================
   NOTIFICATION
   ============================================================ */
.toast {
    position: fixed; bottom: 5rem; right: 1.5rem; z-index: 9000;
    background: var(--white); border-radius: 12px; padding: 1rem 1.5rem;
    box-shadow: var(--sh-lg); display: flex; align-items: center; gap: .8rem;
    font-weight: 600; font-size: .9rem; border-left: 4px solid var(--success);
    transform: translateX(120%); opacity: 0; transition: all .35s ease;
    max-width: 340px;
}
.toast.show { transform: translateX(0); opacity: 1; }
.toast.error { border-left-color: var(--danger); }
.toast i { font-size: 1.2rem; color: var(--success); }
.toast.error i { color: var(--danger); }

/* ============================================================
   RENK TEMASI — Theme Picker
   ============================================================ */

/* Hazır Temalar Grid */
.theme-presets-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}
.theme-preset-card {
    display: flex;
    flex-direction: column;
    gap: 0;
    border: 2px solid var(--border);
    border-radius: 12px;
    background: var(--white);
    cursor: pointer;
    transition: all .2s;
    text-align: left;
    overflow: hidden;
    position: relative;
    padding: 0;
}
.theme-preset-card:hover {
    border-color: var(--brand);
    transform: translateY(-3px);
    box-shadow: var(--sh);
}
.theme-preset-card.active {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(139,35,50,.12);
}
.theme-swatch-bar {
    display: flex;
    height: 12px;
    width: 100%;
}
.theme-swatch-bar span {
    flex: 1;
}
.theme-preset-info {
    padding: .75rem .9rem .85rem;
}
.theme-preset-info strong {
    display: block;
    font-size: .88rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: .15rem;
}
.theme-preset-info span {
    font-size: .75rem;
    color: var(--muted);
}
.theme-check {
    position: absolute;
    top: .6rem;
    right: .6rem;
    font-size: 1rem;
    color: var(--brand);
    opacity: 0;
    transition: opacity .2s;
}
.theme-preset-card.active .theme-check { opacity: 1; }

/* Özel Renkler */
.color-section-hint {
    font-size: .84rem;
    color: var(--muted);
    margin-bottom: 1.4rem;
    margin-top: -.4rem;
}
.color-pickers-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.2rem;
}
.color-picker-group {
    display: flex;
    flex-direction: column;
    gap: .35rem;
}
.color-picker-group label {
    font-size: .82rem;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .5px;
}
.color-picker-row {
    display: flex;
    align-items: center;
    gap: .65rem;
    background: var(--bg);
    border: 1.5px solid var(--border);
    border-radius: 8px;
    padding: .38rem .75rem .38rem .38rem;
    transition: border-color .2s;
}
.color-picker-row:focus-within { border-color: var(--brand); }
.color-picker-row input[type="color"] {
    width: 38px;
    height: 38px;
    border: none;
    padding: 2px;
    cursor: pointer;
    border-radius: 6px;
    background: white;
    flex-shrink: 0;
    -webkit-appearance: none;
    appearance: none;
    box-shadow: 0 1px 4px rgba(0,0,0,.12);
}
.color-picker-row input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; border-radius: 5px; }
.color-picker-row input[type="color"]::-webkit-color-swatch { border: none; border-radius: 5px; }
.color-picker-row input[type="text"] {
    flex: 1;
    border: none;
    background: none;
    font-family: 'Courier New', monospace;
    font-size: .92rem;
    font-weight: 700;
    color: var(--text);
    outline: none;
    padding: 0;
    letter-spacing: .5px;
}
.color-hint {
    font-size: .76rem;
    color: var(--muted);
    line-height: 1.4;
}

/* Anlık Önizleme */
.theme-preview-box {
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border);
    margin-top: .5rem;
    box-shadow: var(--sh);
}
.tp-header {
    padding: 1.4rem 1.6rem;
    background: #1A1208;
}
.tp-badge-el {
    display: inline-flex;
    align-items: center;
    padding: .2rem .75rem;
    border: 1px solid #C8973A;
    border-radius: 50px;
    font-size: .68rem;
    font-weight: 600;
    color: #C8973A;
    margin-bottom: .75rem;
    letter-spacing: .5px;
}
.tp-title {
    color: white;
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: .85rem;
    line-height: 1.4;
}
.tp-em { font-style: italic; color: #C8973A; }
.tp-btns { display: flex; gap: .55rem; flex-wrap: wrap; }
.tp-btn-p {
    padding: .35rem .95rem;
    border-radius: 50px;
    background: #D4622A;
    color: white;
    font-size: .74rem;
    font-weight: 700;
}
.tp-btn-o {
    padding: .35rem .95rem;
    border-radius: 50px;
    border: 1.5px solid rgba(255,255,255,.4);
    color: rgba(255,255,255,.85);
    font-size: .74rem;
}
.tp-light { padding: 1.4rem 1.6rem; background: #FAF7F0; }
.tp-row {
    display: flex;
    align-items: center;
    gap: .8rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}
.tp-pill {
    display: inline-flex;
    padding: .2rem .75rem;
    border-radius: 50px;
    background: rgba(212,98,42,.1);
    color: #D4622A;
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .5px;
}
.tp-check-txt {
    font-size: .76rem;
    color: #4B7C54;
    font-weight: 600;
}
.tp-stat-row {
    display: flex;
    align-items: baseline;
    gap: .45rem;
    margin-bottom: .9rem;
}
.tp-stat-n {
    font-size: 2rem;
    font-weight: 800;
    color: #C8973A;
    line-height: 1;
}
.tp-stat-l { font-size: .76rem; color: #8B7D6B; }
.tp-service-card {
    background: white;
    border-radius: 8px;
    padding: .75rem 1rem;
    border-top: 3px solid #D4622A;
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
}
.tp-service-card strong { font-size: .84rem; display: block; margin-bottom: .2rem; }
.tp-service-card p { font-size: .74rem; color: #8B7D6B; margin: 0; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .admin-main { margin-left: 0; }
    .sidebar-toggle { display: flex; }
    .form-grid { grid-template-columns: 1fr; }
    .stats-editor-grid { grid-template-columns: 1fr; }
    .theme-presets-grid { grid-template-columns: 1fr 1fr; }
    .color-pickers-grid { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
    .admin-content { padding: 1.2rem; }
    .form-card { padding: 1.2rem; }
    .image-field { flex-direction: column; }
    .header-right .view-site-btn span { display: none; }
    .theme-presets-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   2FA SETUP SCREEN
   ============================================================ */
.setup-qr-canvas {
    display: block;
    margin: 20px auto;
    border-radius: 8px;
    background: #fff;
    padding: 8px;
}
.setup-secret-hint {
    font-size: 12px;
    text-align: center;
    opacity: .7;
    margin-bottom: 16px;
}
.setup-secret-hint code {
    word-break: break-all;
    font-size: 11px;
    letter-spacing: 1px;
}
