/* =========================================================
   LIVBEN - BASE CSS
   Dosya: /public/assets/css/base.css
   Amaç: Temel reset, root değişkenler, tipografi, body zemini
   Not: Bileşen stili burada değil; buton/form/card/chat/room ayrı dosyada
========================================================= */

:root {
    /* Genel tema */
    --bg: #f8fafc;
    --surface: #ffffff;
    --surface-soft: #f1f5f9;
    --surface-muted: #eef2f7;

    --text: #0f172a;
    --text-soft: #1e293b;
    --muted: #475569;
    --muted-2: #64748b;

    --border: #e2e8f0;
    --border-strong: #cbd5e1;

    --primary: #0ea5e9;
    --primary-dark: #0284c7;
    --primary-soft: rgba(14, 165, 233, 0.12);

    --success: #16a34a;
    --success-soft: rgba(22, 163, 74, 0.12);

    --danger: #dc2626;
    --danger-soft: rgba(220, 38, 38, 0.12);

    --warning: #f59e0b;
    --warning-soft: rgba(245, 158, 11, 0.12);

    --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow-sm: 0 8px 24px rgba(15, 23, 42, 0.06);
    --shadow-md: 0 18px 40px rgba(15, 23, 42, 0.08);

    --radius-xs: 0.5rem;
    --radius-sm: 0.75rem;
    --radius-md: 1rem;
    --radius-lg: 1.25rem;
    --radius-xl: 1.5rem;

    --font-sans: Inter, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

    --fs-12: 0.75rem;
    --fs-13: 0.8125rem;
    --fs-14: 0.875rem;
    --fs-15: 0.9375rem;
    --fs-16: 1rem;
    --fs-18: 1.125rem;
    --fs-20: 1.25rem;
    --fs-24: 1.5rem;
    --fs-30: 1.875rem;
    --fs-36: 2.25rem;

    --lh-tight: 1.2;
    --lh-normal: 1.5;
    --lh-relaxed: 1.7;

    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;

    /* Oda sayfası alias değişkenleri */
    --room-bg: var(--bg);
    --room-surface: var(--surface);
    --room-soft: var(--surface-soft);
    --room-border: var(--border);
    --room-text: var(--text);
    --room-muted: var(--muted);
    --room-primary: var(--primary);
    --room-primary-dark: var(--primary-dark);
    --room-success: var(--success);
    --room-danger: var(--danger);
    --room-shadow: var(--shadow-sm);
    --room-radius: var(--radius-lg);
    --room-radius-sm: var(--radius-sm);

    color-scheme: light;
}

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

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-width: 320px;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-sans);
    font-size: var(--fs-16);
    line-height: var(--lh-normal);
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body.is-locked {
    overflow: hidden;
}

img,
picture,
svg,
video,
canvas {
    display: block;
    max-width: 100%;
}

img {
    height: auto;
    border: 0;
}

iframe {
    border: 0;
    max-width: 100%;
}

a {
    color: inherit;
    text-decoration: none;
}

a:hover {
    text-decoration: none;
}

button,
input,
select,
textarea {
    font: inherit;
    color: inherit;
}

button {
    border: 0;
    background: none;
    padding: 0;
    cursor: pointer;
}

textarea {
    resize: vertical;
}

input,
select,
textarea {
    outline: none;
}

input:focus,
select:focus,
textarea:focus,
button:focus-visible,
a:focus-visible {
    outline: 3px solid rgba(14, 165, 233, 0.18);
    outline-offset: 2px;
}

ul,
ol {
    margin: 0;
    padding: 0;
    list-style: none;
}

dl,
dd,
blockquote,
figure {
    margin: 0;
}

p {
    margin: 0 0 var(--space-4);
    color: var(--text-soft);
}

p:last-child {
    margin-bottom: 0;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    margin: 0;
    color: var(--text);
    font-weight: 700;
    line-height: var(--lh-tight);
    letter-spacing: -0.02em;
}

h1 {
    font-size: clamp(2rem, 3vw, var(--fs-36));
}

h2 {
    font-size: clamp(1.5rem, 2.3vw, var(--fs-30));
}

h3 {
    font-size: clamp(1.25rem, 2vw, var(--fs-24));
}

h4 {
    font-size: var(--fs-20);
}

h5 {
    font-size: var(--fs-18);
}

h6 {
    font-size: var(--fs-16);
}

small {
    font-size: var(--fs-13);
    color: var(--muted);
}

strong {
    font-weight: 700;
    color: var(--text);
}

hr {
    border: 0;
    border-top: 1px solid var(--border);
    margin: var(--space-6) 0;
}

table {
    width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
}

th,
td {
    text-align: left;
    vertical-align: top;
}

::placeholder {
    color: var(--muted-2);
    opacity: 1;
}

::selection {
    background: rgba(14, 165, 233, 0.18);
    color: var(--text);
}

/* Ortak yüzey yardımcıları */
.surface {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xs);
}

.text-muted {
    color: var(--muted);
}

.text-danger {
    color: var(--danger);
}

.text-success {
    color: var(--success);
}

.bg-soft {
    background: var(--surface-soft);
}

/* Scrollbar */
* {
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}

*::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

*::-webkit-scrollbar-track {
    background: transparent;
}

*::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border: 2px solid transparent;
    border-radius: 999px;
    background-clip: padding-box;
}

*::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
    border: 2px solid transparent;
    background-clip: padding-box;
}

/* Erişilebilirlik */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
