/* =====================================================================
   Rolex Private — ortak temel: renk belirteçleri, sıfırlama, düğmeler,
   alanlar, avatar, yükleniyor göstergesi, dalga efekti, bildirimler.
   Tema <html data-theme="light|dark" data-accent="..."> ile seçilir.
   ===================================================================== */

:root {
    color-scheme: light;

    --accent: #3390ec;
    --accent-2: #2b82d9;
    --accent-soft: rgba(51, 144, 236, .12);
    --accent-rgb: 51, 144, 236;
    --on-accent: #fff;

    --bg: #ffffff;
    --bg-2: #f4f4f5;
    --bg-3: #e9ebee;
    --bg-elev: rgba(255, 255, 255, .94);
    --text: #0b0f14;
    --text-2: #707579;
    --text-3: #a0a8b0;
    --line: #e4e6ea;
    --danger: #e53935;
    --danger-soft: rgba(229, 57, 53, .1);
    --green: #4fae4e;
    --online: #0ac630;

    --bubble-in: #ffffff;
    --bubble-out: #effedd;
    --bubble-out-text: #0b0f14;
    --meta-in: #9aa3ab;
    --meta-out: #4fae4e;
    --check: #2c9bf0;
    --out-accent: #4fae4e;
    --bubble-shadow: 0 1px 2px rgba(16, 35, 47, .14);

    --chat-c1: #dbddbb;
    --chat-c2: #6ba587;
    --chat-c3: #d5d88d;
    --chat-c4: #88b884;
    --pattern-opacity: .1;
    --pattern-filter: none;

    --scrim: rgba(0, 0, 0, .42);
    --shadow-1: 0 1px 3px rgba(0, 0, 0, .08);
    --shadow-menu: 0 10px 38px rgba(0, 0, 0, .16), 0 1px 3px rgba(0, 0, 0, .08);
    --radius: 12px;

    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif,
            "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji";
    --mono: ui-monospace, "Cascadia Code", "SF Mono", Menlo, Consolas, monospace;
    --text-size: 16px;

    --ease: cubic-bezier(.2, .8, .2, 1);
    --ease-out: cubic-bezier(.16, 1, .3, 1);
    --spring: cubic-bezier(.34, 1.56, .64, 1);
}

[data-theme="dark"] {
    color-scheme: dark;

    --accent: #8774e1;
    --accent-2: #9886ee;
    --accent-soft: rgba(135, 116, 225, .16);
    --accent-rgb: 135, 116, 225;

    --bg: #212121;
    --bg-2: #2c2c2c;
    --bg-3: #363636;
    --bg-elev: rgba(37, 37, 37, .92);
    --text: #ffffff;
    --text-2: #aaaaaa;
    --text-3: #6f7377;
    --line: #2f2f2f;
    --danger: #ff595a;
    --danger-soft: rgba(255, 89, 90, .12);

    --bubble-in: #212121;
    --bubble-out: #766ac8;
    --bubble-out-text: #ffffff;
    --meta-in: #8b8f93;
    --meta-out: rgba(255, 255, 255, .62);
    --check: #a8e6ff;
    --out-accent: #ffffff;
    --bubble-shadow: 0 1px 2px rgba(0, 0, 0, .3);

    --chat-c1: #2b3a2f;
    --chat-c2: #1d2b2a;
    --chat-c3: #34362a;
    --chat-c4: #222f27;
    --pattern-opacity: .07;
    --pattern-filter: invert(1);

    --scrim: rgba(0, 0, 0, .6);
    --shadow-1: 0 1px 3px rgba(0, 0, 0, .4);
    --shadow-menu: 0 10px 38px rgba(0, 0, 0, .5), 0 0 0 1px rgba(255, 255, 255, .04);
}

/* vurgu renkleri (Ayarlar › Görünüm) */
[data-accent="violet"] { --accent: #8774e1; --accent-2: #7764d6; --accent-soft: rgba(135, 116, 225, .14); --accent-rgb: 135, 116, 225; --bubble-out: #efeaff; --meta-out: #8774e1; --check: #8774e1; --out-accent: #8774e1; }
[data-accent="green"]  { --accent: #2fb553; --accent-2: #27a048; --accent-soft: rgba(47, 181, 83, .13); --accent-rgb: 47, 181, 83; --bubble-out: #e1f8d8; }
[data-accent="orange"] { --accent: #f08a24; --accent-2: #df7b16; --accent-soft: rgba(240, 138, 36, .14); --accent-rgb: 240, 138, 36; --bubble-out: #fff0dc; --meta-out: #d97c1c; --check: #d97c1c; --out-accent: #d97c1c; }
[data-accent="rose"]   { --accent: #e0507e; --accent-2: #cf426f; --accent-soft: rgba(224, 80, 126, .13); --accent-rgb: 224, 80, 126; --bubble-out: #ffe7ef; --meta-out: #d4507a; --check: #d4507a; --out-accent: #d4507a; }
[data-accent="gold"]   { --accent: #b8913f; --accent-2: #a68034; --accent-soft: rgba(184, 145, 63, .15); --accent-rgb: 184, 145, 63; --bubble-out: #f8f0dc; --meta-out: #a88536; --check: #a88536; --out-accent: #a88536; }
[data-accent="blue"]   { }

[data-theme="dark"][data-accent="blue"]   { --accent: #3d95f0; --accent-2: #5aa6f5; --accent-soft: rgba(61, 149, 240, .16); --accent-rgb: 61, 149, 240; --bubble-out: #2b5278; }
[data-theme="dark"][data-accent="violet"] { --accent: #8774e1; --bubble-out: #766ac8; --meta-out: rgba(255, 255, 255, .62); --check: #a8e6ff; --out-accent: #fff; }
[data-theme="dark"][data-accent="green"]  { --bubble-out: #2f6b3d; }
[data-theme="dark"][data-accent="orange"] { --bubble-out: #8f5520; --meta-out: rgba(255, 255, 255, .62); --check: #a8e6ff; --out-accent: #fff; }
[data-theme="dark"][data-accent="rose"]   { --bubble-out: #84365a; --meta-out: rgba(255, 255, 255, .62); --check: #a8e6ff; --out-accent: #fff; }
[data-theme="dark"][data-accent="gold"]   { --accent: #c9a35a; --accent-2: #d8b36a; --accent-rgb: 201, 163, 90; --bubble-out: #6f5a2c; --meta-out: rgba(255, 255, 255, .62); --check: #a8e6ff; --out-accent: #fff; }

/* ---------------- sıfırlama ---------------- */

*, *::before, *::after { box-sizing: border-box; }

html, body { height: 100%; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 400 15px/1.4 var(--font);
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
    text-rendering: optimizeLegibility;
}

button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
button:disabled { cursor: default; }
a { color: var(--accent); text-decoration: none; }
img, svg, video { display: block; }
h1, h2, h3, h4, p { margin: 0; }
[hidden] { display: none !important; }

:focus-visible { outline: 2px solid rgba(var(--accent-rgb), .55); outline-offset: 2px; }
::selection { background: rgba(var(--accent-rgb), .25); }

.i { width: 24px; height: 24px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.i.fill { fill: currentColor; stroke: none; }

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------------- düğmeler ---------------- */

.btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 48px;
    padding: 0 22px;
    border-radius: 12px;
    background: var(--accent);
    color: var(--on-accent);
    font-weight: 600;
    font-size: 15px;
    letter-spacing: .01em;
    overflow: hidden;
    transition: background .2s, transform .15s var(--ease), opacity .2s, box-shadow .2s;
}
.btn:hover { background: var(--accent-2); }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .55; }
.btn.block { width: 100%; }
.btn.ghost { background: transparent; color: var(--accent); }
.btn.ghost:hover { background: var(--accent-soft); }
.btn.soft { background: var(--accent-soft); color: var(--accent); }
.btn.danger { background: var(--danger); }
.btn.small { height: 36px; padding: 0 14px; border-radius: 10px; font-size: 14px; }
.btn .spin { width: 20px; height: 20px; }
.btn.loading > :not(.spin) { opacity: 0; }
.btn.loading .spin { position: absolute; }

.icon-btn {
    position: relative;
    display: inline-grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: var(--text-2);
    overflow: hidden;
    transition: background .15s, color .15s;
}
.icon-btn:hover { background: var(--bg-2); }
.icon-btn.active { color: var(--accent); }
.icon-btn.sm { width: 34px; height: 34px; }
.icon-btn.sm .i { width: 21px; height: 21px; }

/* ---------------- alanlar (Telegram tarzı yüzen etiket) ---------------- */

.field { position: relative; display: block; margin: 0 0 16px; }

.field input,
.field textarea {
    width: 100%;
    height: 54px;
    padding: 18px 16px 6px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--bg);
    outline: none;
    font-size: 16px;
    transition: border-color .2s, box-shadow .2s;
}
.field textarea { height: auto; min-height: 54px; padding-top: 24px; resize: none; line-height: 1.35; }
.field input:hover { border-color: var(--text-3); }
.field input:focus,
.field textarea:focus { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }

.field label {
    position: absolute;
    left: 13px;
    top: 16px;
    padding: 0 4px;
    color: var(--text-2);
    font-size: 16px;
    pointer-events: none;
    transform-origin: left top;
    transition: transform .2s var(--ease), color .2s, top .2s var(--ease);
}
.field input:focus + label,
.field input:not(:placeholder-shown) + label,
.field textarea:focus + label,
.field textarea:not(:placeholder-shown) + label {
    top: 6px;
    transform: scale(.75);
}
.field input:focus + label,
.field textarea:focus + label { color: var(--accent); }

.field.error input { border-color: var(--danger); box-shadow: inset 0 0 0 1px var(--danger); }
.field.error label { color: var(--danger); }
.field .hint { display: block; margin: 6px 4px 0; color: var(--text-2); font-size: 13px; min-height: 0; transition: color .2s; }
.field.error .hint { color: var(--danger); }
.field.ok .hint { color: var(--green); }
.field .suffix { position: absolute; right: 6px; top: 7px; }
.field .counter { position: absolute; right: 14px; top: 8px; font-size: 12px; color: var(--text-3); }

.shake { animation: shake .42s var(--ease); }
@keyframes shake {
    20% { transform: translateX(-8px); }
    40% { transform: translateX(7px); }
    60% { transform: translateX(-5px); }
    80% { transform: translateX(3px); }
}

/* anahtar */
.switch { position: relative; width: 36px; height: 20px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 20px; background: var(--text-3); transition: background .2s; }
.switch span::after {
    content: ""; position: absolute; left: 2px; top: 2px; width: 16px; height: 16px; border-radius: 50%;
    background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .25); transition: transform .25s var(--spring);
}
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(16px); }

/* ---------------- avatar ---------------- */

.avatar {
    --size: 54px;
    position: relative;
    flex: none;
    display: grid;
    place-items: center;
    width: var(--size);
    height: var(--size);
    border-radius: 50%;
    color: #fff;
    font-weight: 600;
    font-size: calc(var(--size) * .38);
    letter-spacing: .02em;
    text-transform: uppercase;
    user-select: none;
    background: linear-gradient(var(--g1), var(--g2));
}
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.avatar.saved { background: linear-gradient(#5ab0f5, #3d8de0); }
.avatar.saved .i { width: 52%; height: 52%; stroke-width: 1.8; }
.avatar .dot {
    position: absolute; right: 1px; bottom: 1px; width: 14px; height: 14px; border-radius: 50%;
    background: var(--online); border: 2.5px solid var(--bg); transform: scale(0); transition: transform .3s var(--spring);
}
.avatar.online .dot { transform: scale(1); }

/* Telegram'daki gibi 8 renk */
.c0 { --g1: #ff885e; --g2: #ff516a; }
.c1 { --g1: #ffcd6a; --g2: #ffa85c; }
.c2 { --g1: #82b1ff; --g2: #665fff; }
.c3 { --g1: #a0de7e; --g2: #54cb68; }
.c4 { --g1: #53edd6; --g2: #28c9b7; }
.c5 { --g1: #72d5fd; --g2: #2a9ef1; }
.c6 { --g1: #e0a2f3; --g2: #d669ed; }
.c7 { --g1: #c4b07a; --g2: #9b7b3a; }

/* ---------------- yükleniyor ---------------- */

.spin {
    width: 24px; height: 24px; border-radius: 50%;
    border: 2.5px solid currentColor; border-right-color: transparent;
    animation: spin .75s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------- dalga (ripple) ---------------- */

.ripple {
    position: absolute;
    border-radius: 50%;
    background: currentColor;
    opacity: .14;
    pointer-events: none;
    transform: scale(0);
    animation: ripple .55s var(--ease-out) forwards;
}
@keyframes ripple { to { transform: scale(1); opacity: 0; } }

/* ---------------- kısa bildirim (toast) ---------------- */

.toasts {
    position: fixed; left: 50%; bottom: 24px; z-index: 1000; transform: translateX(-50%);
    display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none;
}
.toast {
    display: flex; align-items: center; gap: 10px; max-width: min(92vw, 420px);
    padding: 11px 16px; border-radius: 12px;
    background: rgba(28, 30, 34, .92); color: #fff; font-size: 14px;
    box-shadow: 0 8px 28px rgba(0, 0, 0, .25);
    backdrop-filter: blur(10px);
    pointer-events: auto;
    animation: toast-in .35s var(--spring);
}
.toast.out { animation: toast-out .25s var(--ease) forwards; }
.toast .i { width: 20px; height: 20px; }
.toast button { margin-left: 6px; color: #7dbbff; font-weight: 600; white-space: nowrap; flex: none; }
@keyframes toast-in { from { opacity: 0; transform: translateY(16px) scale(.94); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(10px) scale(.96); } }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
