/* ============================================================
   Vitrin — genel stil (public + admin)
   ============================================================ */

:root {
    --bg-1: #a3132f;
    --bg-2: #4a0717;
    --accent: #ff2d78;
    --accent-2: #7c3aed;
    --card-radius: 18px;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
}

/* ============================================================
   PUBLIC — ilan vitrini
   ============================================================ */

body.public {
    min-height: 100vh;
    background:
        radial-gradient(900px 600px at 50% -8%, rgba(255, 92, 122, .55) 0%, transparent 62%),
        radial-gradient(700px 500px at 100% 100%, rgba(255, 45, 85, .22) 0%, transparent 60%),
        linear-gradient(165deg, var(--bg-1) 0%, #7a0e26 45%, var(--bg-2) 100%);
    background-attachment: fixed;
    color: #fff;
    padding: 6px 5px 40px;
}

.grid-wrap {
    max-width: 1100px;
    margin: 0 auto;
}

.grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
}

@media (min-width: 720px)  { .grid { grid-template-columns: repeat(3, 1fr); gap: 14px; } }
@media (min-width: 1000px) { .grid { grid-template-columns: repeat(4, 1fr); } }

.empty {
    text-align: center;
    opacity: .8;
    margin: 60px 0;
    font-size: 18px;
}

/* Kart: sürekli dönen siyah-beyaz çerçeve */
@property --frame-angle {
    syntax: "<angle>";
    initial-value: 0deg;
    inherits: false;
}

@keyframes frame-spin {
    to { --frame-angle: 360deg; }
}

.card {
    position: relative;
    display: block;
    border-radius: var(--card-radius);
    padding: 4.5px; /* çerçeve kalınlığı */
    background: conic-gradient(from var(--frame-angle), #fff 0deg, #111 90deg, #fff 180deg, #111 270deg, #fff 360deg);
    animation: frame-spin 3.5s linear infinite;
    text-decoration: none;
    box-shadow: 0 8px 22px rgba(40, 0, 10, .45);
    transition: transform .18s ease, box-shadow .18s ease;
    -webkit-tap-highlight-color: transparent;
}

@media (prefers-reduced-motion: reduce) {
    .card { animation: none; }
}

.card:hover,
.card:focus-visible {
    transform: translateY(-4px);
    box-shadow: 0 16px 34px rgba(0, 0, 0, .45);
}

.card-media {
    position: relative;
    border-radius: calc(var(--card-radius) - 4.5px);
    overflow: hidden;
    aspect-ratio: 3 / 5;
    background: #2a0610;
}

.card-media img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    opacity: 0;
    transition: opacity .7s ease, transform .35s ease;
}

.card-media img.is-active { opacity: 1; }

.card:hover .card-media img { transform: scale(1.05); }

/* Birden fazla resim: üstte hikaye tarzı ince çizgiler */
.card-dots {
    position: absolute;
    top: 3px;
    left: 8px;
    right: 8px;
    display: flex;
    gap: 3px;
    pointer-events: none;
    z-index: 4;
}

.card-dots i {
    flex: 1;
    height: 2px;
    border-radius: 2px;
    background: rgba(255, 255, 255, .35);
    transition: background .3s ease;
}

.card-dots i.is-active { background: #fff; }

.card-media .no-img {
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(45deg, #4a0a1c, #4a0a1c 12px, #3a0716 12px, #3a0716 24px);
}

/* Sağ dikey "Teyitli Profil" etiketi (WHATSAPP'ın karşısı). Arka planı her yenilemede sıradaki renge geçer (index.php). */
:root { --badge-bg: linear-gradient(135deg, #ff2d78, #ff5e9c); }
:root[data-badge="siyah"] { --badge-bg: linear-gradient(135deg, #0d0d0d, #2e2e2e); }
:root[data-badge="bordo"] { --badge-bg: linear-gradient(135deg, #5c0a1d, #8f1734); }
:root[data-badge="gul"]   { --badge-bg: linear-gradient(135deg, #c2185b, #e8608a); }

.badge {
    position: absolute;
    bottom: 54px;
    right: 0;
    writing-mode: vertical-rl;
    background: var(--badge-bg);
    color: #fff;
    font-weight: 800;
    font-size: 8.5px;
    letter-spacing: .8px;
    text-transform: uppercase;
    white-space: nowrap;
    padding: 8px 3px;
    border-radius: 8px 0 0 8px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, .35);
    z-index: 3;
}

/* Sol dikey WHATSAPP etiketi */
.wa-tag {
    position: absolute;
    bottom: 54px;
    left: 0;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    background: linear-gradient(180deg, #ff2d78, #ff5e9c);
    color: #fff;
    font-weight: 800;
    font-size: 8.5px;
    letter-spacing: .8px;
    padding: 8px 3px;
    border-radius: 0 8px 8px 0;
    box-shadow: 0 3px 10px rgba(255, 45, 120, .5);
    z-index: 3;
}

/* İsim: alt kısımda, karartma gradyanı üstünde */
.card-name {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 30px 8px 9px;
    color: #fff;
    font-size: 18px;
    line-height: 1.2;
    font-weight: 800;
    text-align: center;
    text-shadow: 0 2px 8px rgba(0, 0, 0, .8);
    background: linear-gradient(to top, rgba(0, 0, 0, .72) 12%, transparent 100%);
    z-index: 2;
}
.card-name .card-phone {
    display: table;
    margin: 0 auto 6px;
    padding: 3px 10px;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: .6px;
    font-variant-numeric: tabular-nums;
    text-shadow: none;
    color: #fff;
    background: rgba(255, 255, 255, .14);
    border: 1px solid rgba(255, 255, 255, .28);
    border-radius: 999px;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

/* ============================================================
   ADMIN — panel
   ============================================================ */

body.admin {
    background: #0f1220;
    color: #e6e8f0;
    min-height: 100vh;
}

a { color: #8ab4ff; }

/* Giriş ekranı */
body.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: linear-gradient(160deg, #1a1440, #0f1220);
}

.login-box {
    width: 100%;
    max-width: 360px;
    background: #171a2b;
    border: 1px solid #262a42;
    border-radius: 16px;
    padding: 28px 24px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, .5);
}
.login-box h1 { margin: 0 0 18px; font-size: 22px; }

/* Üst bar */
.topbar {
    background: #171a2b;
    border-bottom: 1px solid #262a42;
    position: sticky;
    top: 0;
    z-index: 10;
}
.topbar-in {
    max-width: 1200px;
    margin: 0 auto;
    padding: 12px 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}
.topbar .who { color: #9aa0bd; font-size: 14px; }
.topbar nav { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.topbar nav .inline-form { margin: 0; display: inline; }
.topbar nav .link-btn {
    background: none;
    border: none;
    padding: 0;
    color: inherit;
    font: inherit;
    cursor: pointer;
}

.panel {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 18px 60px;
}

/* İstatistik kartları */
.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 14px;
    margin-bottom: 24px;
}
.stat {
    background: linear-gradient(150deg, #1c2036, #171a2b);
    border: 1px solid #262a42;
    border-radius: 14px;
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.stat .num { font-size: 30px; font-weight: 800; color: #fff; }
.stat .lbl { font-size: 13px; color: #9aa0bd; }

/* İki sütun düzen */
.cols {
    display: grid;
    grid-template-columns: minmax(300px, 380px) 1fr;
    gap: 20px;
    margin-bottom: 24px;
}
@media (max-width: 860px) { .cols { grid-template-columns: 1fr; } }

.box {
    background: #171a2b;
    border: 1px solid #262a42;
    border-radius: 16px;
    padding: 20px;
}
.box h2 { margin: 0 0 16px; font-size: 17px; }

/* Formlar */
form label {
    display: block;
    margin-bottom: 14px;
    font-size: 14px;
    color: #c7cbe0;
}
form label small { color: #7f85a3; font-weight: 400; }
form label.check { display: flex; align-items: center; gap: 8px; }

input[type="text"],
input[type="password"],
input[type="number"],
input[type="file"],
select {
    width: 100%;
    margin-top: 6px;
    padding: 10px 12px;
    background: #0f1220;
    border: 1px solid #2d3250;
    border-radius: 10px;
    color: #fff;
    font-size: 14px;
}
input[type="file"] { padding: 8px; }
label.check input { width: auto; margin: 0; }

input:focus, select:focus {
    outline: none;
    border-color: var(--accent-2);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, .25);
}

button {
    background: linear-gradient(135deg, var(--accent-2), var(--accent));
    color: #fff;
    border: none;
    padding: 11px 20px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: filter .15s ease;
}
button:hover { filter: brightness(1.1); }

.form-actions { display: flex; align-items: center; gap: 12px; margin-top: 4px; }
.btn-ghost {
    padding: 11px 18px;
    border: 1px solid #2d3250;
    border-radius: 10px;
    text-decoration: none;
    color: #c7cbe0;
}

.preview {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
    gap: 8px;
    margin-top: 8px;
}

.preview .preview-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    margin: 0;
    font-size: 12px;
    cursor: pointer;
}

.preview img {
    width: 100%;
    aspect-ratio: 3 / 5;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid #2d3250;
}

/* Tablolar */
table.list {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
table.list th {
    text-align: left;
    color: #9aa0bd;
    font-weight: 600;
    padding: 8px 10px;
    border-bottom: 1px solid #262a42;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .5px;
}
table.list td {
    padding: 10px;
    border-bottom: 1px solid #1e2236;
    vertical-align: middle;
}
td.thumb img {
    width: 44px; height: 56px;
    object-fit: cover;
    border-radius: 8px;
}
.muted { color: #7f85a3; }

.pill {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}
.pill.on  { background: rgba(34, 197, 94, .18);  color: #4ade80; }
.pill.off { background: rgba(148, 163, 184, .18); color: #94a3b8; }

.row-actions { display: flex; align-items: center; gap: 12px; white-space: nowrap; }
.row-actions form { margin: 0; display: inline; }
.link-danger {
    background: none;
    border: none;
    color: #f87171;
    padding: 0;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}
.link-danger:hover { text-decoration: underline; filter: none; }

/* Bildirimler */
.notice {
    background: rgba(34, 197, 94, .12);
    border: 1px solid rgba(34, 197, 94, .3);
    color: #86efac;
    padding: 12px 16px;
    border-radius: 12px;
    margin-bottom: 20px;
}
.error {
    background: rgba(248, 113, 113, .12);
    border: 1px solid rgba(248, 113, 113, .3);
    color: #fca5a5;
    padding: 10px 14px;
    border-radius: 10px;
    margin-bottom: 14px;
}
