/* =============================================================================
   MotoBlog — shared design system (fresh editorial blog, warm light palette)
   Admin, login ve public home buradan beslenir.
   ============================================================================= */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,300..900;1,9..144,300..900&family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
    /* warm paper palette */
    --bg:           #faf8f3;
    --bg-2:         #f3ede2;
    --surface:      #ffffff;
    --surface-2:    #f7f2e8;
    --ink:          #1c1917;
    --ink-2:        #44403c;
    --ink-3:        #57534e;
    --muted:        #78716c;
    --muted-2:      #a8a29e;
    --border:       #e7dfd0;
    --border-soft:  #efe8d9;

    /* accents — burnt sienna / amber journal */
    --accent:       #c2410c;
    --accent-2:     #ea580c;
    --accent-3:     #f59e0b;
    --accent-soft:  #fff4e6;
    --accent-ink:   #7c2d12;

    /* semantic */
    --success:      #15803d;
    --success-soft: #ecfdf5;
    --danger:       #b91c1c;
    --danger-soft:  #fef2f2;
    --info:         #0369a1;
    --info-soft:    #eff6ff;

    /* elevation */
    --shadow-xs: 0 1px 2px rgba(28,25,23,.05);
    --shadow-sm: 0 2px 6px -2px rgba(28,25,23,.08), 0 1px 2px rgba(28,25,23,.04);
    --shadow-md: 0 10px 30px -15px rgba(28,25,23,.18), 0 2px 4px rgba(28,25,23,.04);
    --shadow-lg: 0 30px 60px -30px rgba(28,25,23,.25), 0 4px 8px rgba(28,25,23,.04);

    --radius-sm: 8px;
    --radius:    12px;
    --radius-lg: 18px;
    --radius-xl: 24px;

    --font-sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --font-display: 'Fraunces', 'Georgia', serif;
    --font-mono: 'JetBrains Mono', 'SFMono-Regular', monospace;
}

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

html { scroll-behavior: smooth; }
body {
    font-family: var(--font-sans);
    background: var(--bg);
    color: var(--ink);
    margin: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.55;
    background-image:
        radial-gradient(1200px 400px at 90% -10%, rgba(234, 88, 12, 0.06), transparent 60%),
        radial-gradient(800px 300px at -10% 110%, rgba(245, 158, 11, 0.05), transparent 60%);
    background-attachment: fixed;
}

a { color: var(--accent); text-decoration: none; transition: color .15s ease; }
a:hover { color: var(--accent-2); }

/* -----------------------------------------------------------------------------
   ADMIN SHELL
   ----------------------------------------------------------------------------- */
.sidebar {
    width: 260px;
    background: var(--surface);
    border-right: 1px solid var(--border);
    color: var(--ink-2);
    height: 100vh;
    position: fixed;
    padding: 28px 0 20px;
    display: flex;
    flex-direction: column;
    z-index: 10;
}
.sidebar h2 {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.35rem;
    letter-spacing: -0.02em;
    color: var(--ink);
    padding: 0 24px;
    margin: 0 0 4px;
    display: flex;
    align-items: center;
    gap: 12px;
}
.sidebar h2::before {
    content: '';
    display: inline-block;
    width: 32px; height: 32px;
    border-radius: 10px;
    background: #fff url('/images/motoblog-logo.svg') center / 82% no-repeat;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-xs);
    flex-shrink: 0;
}
.sidebar-sub {
    padding: 0 24px;
    font-family: var(--font-mono);
    font-size: 0.68rem;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 28px;
}
.sidebar a {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--ink-2);
    padding: 12px 24px;
    font-weight: 500;
    font-size: 0.94rem;
    transition: background .15s ease, color .15s ease;
    border-left: 3px solid transparent;
    margin-right: 0;
}
.sidebar a:hover {
    color: var(--accent);
    background: var(--accent-soft);
}
.sidebar a.active {
    color: var(--accent);
    background: var(--accent-soft);
    border-left-color: var(--accent);
    font-weight: 600;
}
.sidebar-footer {
    margin-top: auto;
    border-top: 1px solid var(--border-soft);
    padding: 14px 16px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}
.sidebar-footer a {
    margin: 0;
    border-left: 0;
    border-radius: 10px;
    padding: 10px 12px;
}
.sidebar-footer .logout-link {
    flex: 1;
    color: var(--danger);
}
.sidebar-footer .logout-link:hover {
    background: var(--danger-soft);
    color: var(--danger);
}
.sidebar-footer .settings-link {
    width: 42px;
    justify-content: center;
    padding: 10px 0;
    color: var(--ink-2);
    background: var(--surface-2);
    border: 1px solid var(--border);
    font-size: 1rem;
    line-height: 1;
}
.sidebar-footer .settings-link:hover {
    color: var(--accent);
    background: var(--accent-soft);
    border-color: var(--accent);
}
.sidebar-footer .settings-link.active {
    color: var(--accent);
    background: var(--accent-soft);
    border-color: var(--accent);
}

.main-content {
    margin-left: 260px;
    padding: 36px 40px 60px;
    min-height: 100vh;
}

header {
    background: var(--surface);
    padding: 22px 28px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 28px;
}
header h1 {
    font-family: var(--font-display);
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--ink);
    margin: 0;
    font-size: 1.5rem;
}

/* -----------------------------------------------------------------------------
   CARDS & SURFACES
   ----------------------------------------------------------------------------- */
.card {
    background: var(--surface);
    padding: 28px 30px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    margin-bottom: 24px;
}
.card h2, .card h3, .card h4 {
    font-family: var(--font-display);
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--ink);
    margin-top: 0;
}
.card h3 { font-size: 1.25rem; margin-bottom: 14px; }
.card h4 { font-size: 1.05rem; margin-bottom: 10px; color: var(--ink-2); }
.card p { color: var(--ink-3); margin: 0 0 14px; }

/* -----------------------------------------------------------------------------
   FORMS
   ----------------------------------------------------------------------------- */
input[type="text"], input[type="email"], input[type="password"], input[type="date"],
input[type="number"], input[type="file"], input[type="search"], textarea, select {
    width: 100%;
    padding: 12px 14px;
    margin: 6px 0 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--ink);
    font-family: inherit;
    font-size: 0.95rem;
    transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
input:focus, textarea:focus, select:focus {
    border-color: var(--accent);
    outline: none;
    box-shadow: 0 0 0 3px rgba(194, 65, 12, 0.12);
    background: var(--surface);
}
input::placeholder, textarea::placeholder { color: var(--muted-2); }
textarea { min-height: 100px; resize: vertical; font-family: inherit; }

input[type="file"] { padding: 10px; background: var(--surface-2); cursor: pointer; }
input[type="checkbox"] {
    width: 18px; height: 18px;
    accent-color: var(--accent);
    cursor: pointer;
    margin: 0;
}

label {
    font-weight: 500;
    color: var(--ink-2);
    font-size: 0.88rem;
    display: block;
    margin-bottom: 4px;
}

form { margin: 0; }

.form-row { display: flex; gap: 14px; flex-wrap: wrap; }
.form-row .form-group { flex: 1; min-width: 150px; }

/* -----------------------------------------------------------------------------
   BUTTONS
   ----------------------------------------------------------------------------- */
button, .btn-primary, .btn {
    background: var(--ink);
    color: #fff;
    border: 1px solid var(--ink);
    padding: 11px 20px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-family: inherit;
    font-size: 0.94rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: transform .08s ease, box-shadow .15s ease, background .15s ease;
    box-shadow: var(--shadow-xs);
}
button:hover, .btn-primary:hover, .btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}
button:active, .btn-primary:active, .btn:active { transform: translateY(0); }

.btn-accent {
    background: linear-gradient(135deg, var(--accent-2) 0%, var(--accent) 100%);
    border-color: var(--accent);
    color: #fff;
    box-shadow: 0 6px 14px -8px rgba(194, 65, 12, 0.5);
}
.btn-accent:hover {
    box-shadow: 0 12px 24px -10px rgba(194, 65, 12, 0.6);
}

.btn-ghost {
    background: transparent;
    color: var(--ink-2);
    border: 1px solid var(--border);
    box-shadow: none;
}
.btn-ghost:hover {
    background: var(--surface-2);
    color: var(--ink);
    border-color: var(--muted-2);
}

.btn-delete {
    background: var(--surface);
    color: var(--danger);
    border: 1px solid rgba(185, 28, 28, 0.25);
    padding: 7px 13px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    box-shadow: none;
    transition: background .15s ease, border-color .15s ease;
}
.btn-delete:hover {
    background: var(--danger-soft);
    border-color: var(--danger);
    transform: none;
}

/* -----------------------------------------------------------------------------
   TABLES
   ----------------------------------------------------------------------------- */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 8px;
}
th, td {
    text-align: left;
    padding: 14px 12px;
    border-bottom: 1px solid var(--border-soft);
    color: var(--ink-2);
    font-size: 0.94rem;
}
th {
    font-family: var(--font-mono);
    font-weight: 500;
    color: var(--muted);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    padding-top: 10px;
    padding-bottom: 10px;
    border-bottom-color: var(--border);
}
tbody tr:hover { background: var(--surface-2); }
tbody tr:last-child td { border-bottom: none; }

/* -----------------------------------------------------------------------------
   BADGES / CHIPS / ALERTS
   ----------------------------------------------------------------------------- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: var(--success-soft);
    color: var(--success);
    border: 1px solid rgba(21, 128, 61, 0.18);
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    font-family: var(--font-mono);
    letter-spacing: 0.04em;
}
.badge-draft {
    background: var(--surface-2);
    color: var(--muted);
    border-color: var(--border);
}
.badge-info {
    background: var(--info-soft);
    color: var(--info);
    border-color: rgba(3, 105, 161, 0.18);
}
.badge-accent {
    background: var(--accent-soft);
    color: var(--accent);
    border-color: rgba(194, 65, 12, 0.18);
}

.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    font-size: 0.92rem;
    border: 1px solid;
}
.alert-error { background: var(--danger-soft); color: var(--danger); border-color: rgba(185,28,28,.2); }
.alert-success { background: var(--success-soft); color: var(--success); border-color: rgba(21,128,61,.2); }

/* -----------------------------------------------------------------------------
   LAYOUT HELPERS
   ----------------------------------------------------------------------------- */
.grid-container { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.eq-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin-top: 12px; }
.eq-item {
    background: var(--surface-2);
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background .15s ease, border-color .15s ease;
}
.eq-item:hover { background: #fff; border-color: var(--accent); }
.eq-item label { color: var(--ink-2); font-size: 0.9rem; margin: 0; }

.info-box {
    font-family: var(--font-display);
    font-size: 2.2rem;
    font-weight: 500;
    color: var(--accent);
    letter-spacing: -0.02em;
    line-height: 1;
}

/* filter pills — admin equipments */
.filter-pill {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--ink-2);
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: all .15s ease;
}
.filter-pill:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.filter-pill.active {
    background: var(--ink);
    border-color: var(--ink);
    color: #fff;
    font-weight: 600;
}

/* -----------------------------------------------------------------------------
   SCROLLBAR
   ----------------------------------------------------------------------------- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--muted-2); }

/* -----------------------------------------------------------------------------
   LEGACY INLINE COLOR FIX-UPS
   Old inline styles from the dark theme — normalize them for the light theme.
   ----------------------------------------------------------------------------- */
[style*="color: #6b7280"], [style*="color:#6b7280"] { color: var(--muted) !important; }
[style*="color: #374151"], [style*="color:#374151"] { color: var(--ink-2) !important; }
[style*="color: #94a3b8"], [style*="color:#94a3b8"] { color: var(--muted) !important; }
[style*="color: #fbbf24"], [style*="color:#fbbf24"] { color: var(--accent) !important; }
[style*="color:#2563eb"] { color: var(--accent) !important; }
[style*="color:#059669"] { color: var(--success) !important; }
[style*="background:#e5e7eb"] { background: var(--surface-2) !important; }
[style*="background:#059669"] { background: var(--success) !important; }
[style*="background:#8b5cf6"] { background: var(--ink) !important; }
[style*="border-bottom:1px solid #e5e7eb"] { border-bottom: 1px solid var(--border) !important; }
[style*="border-top: 1px solid #374151"] { border-top: 1px solid var(--border-soft) !important; }

/* -----------------------------------------------------------------------------
   RESPONSIVE
   ----------------------------------------------------------------------------- */
@media (max-width: 900px) {
    .sidebar {
        position: relative;
        width: 100%;
        height: auto;
        flex-direction: row;
        flex-wrap: wrap;
        padding: 16px;
        border-right: none;
        border-bottom: 1px solid var(--border);
    }
    .sidebar h2 { flex-basis: 100%; margin-bottom: 12px; padding: 0 4px; }
    .sidebar-sub { display: none; }
    .sidebar a { padding: 8px 14px; border-left: none; border-radius: 999px; font-size: 0.85rem; }
    .sidebar a.active { border-left: none; background: var(--ink); color: #fff; }
    .sidebar-footer { margin-top: 0; border-top: none; padding: 0; }
    .sidebar-footer .logout-link { flex: 0; }
    .main-content { margin-left: 0; padding: 20px; }
    .grid-container { grid-template-columns: 1fr; }
}
