/* KısaLink — Premium Design System */

:root {
    --brand: #2563eb;
    --brand-light: #3b82f6;
    --surface: #ffffff;
    --surface-muted: #f1f5f9;
    --border: #e2e8f0;
    --text: #0f172a;
    --text-muted: #64748b;
    --sidebar: #0b1120;
    --sidebar-hover: #151d2e;
    --radius: 1rem;
    --radius-lg: 1.25rem;
}

.dark,
html.dark {
    --surface: #111827;
    --surface-elevated: #111827;
    --surface-muted: #0f172a;
    --surface-input: #1a2332;
    --border: #1e293b;
    --text: #f8fafc;
    --text-muted: #94a3b8;
    color-scheme: dark;
}

/* Base */
body {
    font-feature-settings: "cv02", "cv03", "cv04", "cv11";
    -webkit-font-smoothing: antialiased;
}

/* Mesh / grid backgrounds */
.bg-mesh {
    background-color: var(--surface);
    background-image:
        radial-gradient(at 40% 20%, rgba(59, 130, 246, 0.08) 0, transparent 50%),
        radial-gradient(at 80% 0%, rgba(99, 102, 241, 0.06) 0, transparent 50%),
        radial-gradient(at 0% 50%, rgba(14, 165, 233, 0.05) 0, transparent 50%);
}
.dark .bg-mesh {
    background-color: #0b1120;
    background-image:
        radial-gradient(at 40% 20%, rgba(59, 130, 246, 0.12) 0, transparent 50%),
        radial-gradient(at 80% 0%, rgba(99, 102, 241, 0.08) 0, transparent 50%);
}

.bg-grid {
    background-image: linear-gradient(rgba(148, 163, 184, 0.07) 1px, transparent 1px),
                      linear-gradient(90deg, rgba(148, 163, 184, 0.07) 1px, transparent 1px);
    background-size: 48px 48px;
}
.dark .bg-grid {
    background-image: linear-gradient(rgba(148, 163, 184, 0.04) 1px, transparent 1px),
                      linear-gradient(90deg, rgba(148, 163, 184, 0.04) 1px, transparent 1px);
}

/* Glass */
.glass {
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.04);
}
.dark .glass {
    background: rgba(17, 24, 39, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.glass-nav {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
}
.dark .glass-nav {
    background: rgba(11, 17, 32, 0.9);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 0.875rem;
    padding: 0.625rem 1.25rem;
    border-radius: 0.75rem;
    transition: all 0.2s ease;
    cursor: pointer;
}
.btn-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 50%, #1d4ed8 100%);
    color: #fff;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}
.btn-primary:hover {
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.45);
    transform: translateY(-1px);
}
.btn-secondary {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
}
.btn-secondary:hover {
    background: var(--surface-muted);
    border-color: #cbd5e1;
}
.btn-ghost {
    color: var(--text-muted);
    background: transparent;
}
.btn-ghost:hover {
    background: var(--surface-muted);
    color: var(--text);
}
.btn-lg {
    padding: 0.875rem 1.75rem;
    font-size: 1rem;
    border-radius: 0.875rem;
}

/* Cards */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: 0 1px 3px rgba(0,0,0,.03);
}
.card-elevated {
    background: var(--surface-elevated, var(--surface));
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
}
html.dark .card-elevated,
html.dark .card {
    background: #111827;
    border-color: #1e293b;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.25);
}
html.dark .stat-card {
    background: #111827;
    border-color: #1e293b;
}
html.dark .stat-card:hover {
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}
.stat-card {
    position: relative;
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    transition: transform 0.2s, box-shadow 0.2s;
}
.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.08);
}
.stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent, #3b82f6), transparent);
    opacity: 0.8;
}
.stat-card.accent-blue { --accent: #3b82f6; }
.stat-card.accent-green { --accent: #22c55e; }
.stat-card.accent-purple { --accent: #a855f7; }
.stat-card.accent-orange { --accent: #f59e0b; }
.stat-card.accent-red { --accent: #ef4444; }

/* Form inputs */
.input {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    color: var(--text);
    transition: border-color 0.2s, box-shadow 0.2s;
}
.input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}
.input-group label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.5rem;
}

/* Dark mode — form controls (Tailwind preflight override) */
/* Dark mode — all native form elements inside panel */
html.dark input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]),
html.dark select,
html.dark textarea {
    background-color: #1a2332 !important;
    border-color: #334155 !important;
    color: #f1f5f9 !important;
}
html.dark .input,
html.dark input.input,
html.dark select.input,
html.dark textarea.input {
    background-color: #1a2332 !important;
    border-color: #334155 !important;
    color: #f1f5f9 !important;
}
html.dark .input::placeholder {
    color: #64748b;
}
html.dark .input:focus {
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}
html.dark select.input option {
    background-color: #1a2332;
    color: #f1f5f9;
}
html.dark input:-webkit-autofill,
html.dark input:-webkit-autofill:hover,
html.dark input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 1000px #1a2332 inset !important;
    -webkit-text-fill-color: #f1f5f9 !important;
    caret-color: #f1f5f9;
}
html.dark .input-group label {
    color: #e2e8f0;
}
html.dark .page-header h1 {
    color: #f8fafc;
}
html.dark .page-header p {
    color: #94a3b8;
}
html.dark .btn-secondary {
    background: #1a2332 !important;
    border-color: #334155 !important;
    color: #f1f5f9 !important;
}
html.dark .btn-secondary:hover {
    background: #243044 !important;
    border-color: #475569 !important;
}
html.dark .btn-ghost {
    color: #94a3b8;
}
html.dark .btn-ghost:hover {
    background: #1a2332;
    color: #f1f5f9;
}
html.dark .table-pro thead th {
    background: #0f172a;
    color: #94a3b8;
    border-bottom-color: #1e293b;
}
html.dark .table-pro tbody td {
    border-bottom-color: #1e293b;
    color: #e2e8f0;
}
html.dark .table-pro tbody tr:hover {
    background: #1a2332;
}

/* Tables */
.table-pro {
    width: 100%;
    font-size: 0.875rem;
    border-collapse: separate;
    border-spacing: 0;
}
.table-pro thead th {
    padding: 0.875rem 1.25rem;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    background: var(--surface-muted);
    border-bottom: 1px solid var(--border);
}
.table-pro thead th:first-child { border-radius: 0.75rem 0 0 0; }
.table-pro thead th:last-child { border-radius: 0 0.75rem 0 0; }
.table-pro tbody td {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
.table-pro tbody tr {
    transition: background 0.15s;
}
.table-pro tbody tr:hover {
    background: var(--surface-muted);
}
.table-pro tbody tr:last-child td {
    border-bottom: none;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.625rem;
    font-size: 0.6875rem;
    font-weight: 600;
    border-radius: 9999px;
    letter-spacing: 0.02em;
}
.badge-success { background: #dcfce7; color: #15803d; }
.badge-danger { background: #fee2e2; color: #b91c1c; }
.badge-warning { background: #fef3c7; color: #b45309; }
.badge-info { background: #dbeafe; color: #1d4ed8; }
.badge-neutral { background: #f1f5f9; color: #475569; }
.dark .badge-success { background: rgba(34,197,94,.15); color: #4ade80; }

/* Link table actions */
.link-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
    gap: 0.375rem;
    min-width: 16rem;
}
.link-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.4375rem 0.625rem;
    font-size: 0.6875rem;
    font-weight: 600;
    line-height: 1;
    border-radius: 0.5rem;
    border: 1px solid transparent;
    white-space: nowrap;
    transition: all 0.15s ease;
    cursor: pointer;
    text-decoration: none;
}
.link-action-btn svg {
    flex-shrink: 0;
    opacity: 0.9;
}
.link-action-btn--copy {
    color: #475569;
    background: #f8fafc;
    border-color: #e2e8f0;
}
.link-action-btn--copy:hover {
    color: #2563eb;
    background: #eff6ff;
    border-color: #bfdbfe;
}
.link-action-btn--qr {
    color: #6d28d9;
    background: #f5f3ff;
    border-color: #ddd6fe;
}
.link-action-btn--qr:hover {
    color: #5b21b6;
    background: #ede9fe;
    border-color: #c4b5fd;
}
.link-action-btn--stats {
    color: #047857;
    background: #ecfdf5;
    border-color: #a7f3d0;
}
.link-action-btn--stats:hover {
    color: #065f46;
    background: #d1fae5;
    border-color: #6ee7b7;
}
.link-action-btn--pause {
    color: #b45309;
    background: #fffbeb;
    border-color: #fde68a;
}
.link-action-btn--pause:hover {
    color: #92400e;
    background: #fef3c7;
    border-color: #fcd34d;
}
.link-action-btn--play {
    color: #1d4ed8;
    background: #eff6ff;
    border-color: #bfdbfe;
}
.link-action-btn--play:hover {
    color: #1e40af;
    background: #dbeafe;
    border-color: #93c5fd;
}
.link-action-btn--delete {
    color: #b91c1c;
    background: #fef2f2;
    border-color: #fecaca;
}
.link-action-btn--delete:hover {
    color: #991b1b;
    background: #fee2e2;
    border-color: #fca5a5;
}
.link-action-btn.is-copied {
    color: #15803d !important;
    background: #dcfce7 !important;
    border-color: #86efac !important;
}
html.dark .link-action-btn--copy {
    color: #cbd5e1;
    background: #1e293b;
    border-color: #334155;
}
html.dark .link-action-btn--copy:hover {
    color: #93c5fd;
    background: rgba(37, 99, 235, 0.15);
    border-color: rgba(59, 130, 246, 0.35);
}
html.dark .link-action-btn--qr {
    color: #c4b5fd;
    background: rgba(109, 40, 217, 0.15);
    border-color: rgba(139, 92, 246, 0.25);
}
html.dark .link-action-btn--stats {
    color: #6ee7b7;
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(52, 211, 153, 0.25);
}
html.dark .link-action-btn--pause {
    color: #fcd34d;
    background: rgba(245, 158, 11, 0.12);
    border-color: rgba(251, 191, 36, 0.25);
}
html.dark .link-action-btn--play {
    color: #93c5fd;
    background: rgba(37, 99, 235, 0.12);
    border-color: rgba(59, 130, 246, 0.25);
}
html.dark .link-action-btn--delete {
    color: #fca5a5;
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(248, 113, 113, 0.25);
}
.dark .badge-danger { background: rgba(239,68,68,.15); color: #f87171; }
.dark .badge-warning { background: rgba(245,158,11,.15); color: #fbbf24; }
.dark .badge-info { background: rgba(59,130,246,.15); color: #60a5fa; }
.dark .badge-neutral { background: rgba(148,163,184,.1); color: #94a3b8; }

/* Panel sidebar */
.panel-sidebar {
    background: linear-gradient(180deg, #0b1120 0%, #0f172a 100%);
    border-right: 1px solid rgba(255,255,255,.06);
}
.panel-sidebar .nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    margin: 0.125rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #94a3b8;
    border-radius: 0.75rem;
    transition: all 0.2s;
}
.panel-sidebar .nav-item:hover {
    color: #f1f5f9;
    background: rgba(255,255,255,.05);
}
.panel-sidebar .nav-item.active {
    color: #fff;
    background: linear-gradient(135deg, rgba(59,130,246,.2), rgba(37,99,235,.1));
    border: 1px solid rgba(59,130,246,.25);
    box-shadow: 0 0 20px rgba(59,130,246,.1);
}
.panel-sidebar .nav-item.active svg {
    color: #60a5fa;
}

.dashboard-sidebar {
    background: var(--surface);
    border-right: 1px solid var(--border);
}
.dashboard-sidebar .nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    margin: 0.125rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-muted);
    border-radius: 0.75rem;
    transition: all 0.2s;
}
.dashboard-sidebar .nav-item:hover {
    color: var(--text);
    background: var(--surface-muted);
}
.dashboard-sidebar .nav-item.active {
    color: #2563eb;
    background: #eff6ff;
    font-weight: 600;
}
.dark .dashboard-sidebar .nav-item.active {
    background: rgba(59,130,246,.12);
    color: #60a5fa;
}

/* Section headers */
.section-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #3b82f6;
}
.section-title {
    font-size: 2.25rem;
    font-weight: 800;
    letter-spacing: -0.025em;
    line-height: 1.2;
}

/* Gradient text */
.gradient-text {
    background: linear-gradient(135deg, #3b82f6 0%, #6366f1 50%, #8b5cf6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Hero glow */
.hero-glow {
    position: absolute;
    width: 600px; height: 600px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(59,130,246,.15) 0%, transparent 70%);
    pointer-events: none;
}

/* Counter */
.counter { font-variant-numeric: tabular-nums; }

/* FAQ */
.faq-content { transition: all 0.3s ease; }
.faq-content:not(.hidden) { animation: slideDown 0.3s ease; }
@keyframes slideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
.dark ::-webkit-scrollbar-thumb { background: #334155; }

:focus-visible { outline: 2px solid #3b82f6; outline-offset: 2px; }
::selection { background: rgba(59, 130, 246, 0.25); }

#flash-message { animation: slideInRight 0.3s ease, fadeOut 0.3s ease 4s forwards; }
@keyframes slideInRight { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes fadeOut { to { opacity: 0; visibility: hidden; } }

/* Auth split */
.auth-brand {
    background: linear-gradient(135deg, #0b1120 0%, #1e3a8a 50%, #2563eb 100%);
    position: relative;
    overflow: hidden;
}
.auth-brand::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

/* Trusted logos strip */
.logo-strip img, .logo-strip span {
    opacity: 0.5;
    filter: grayscale(100%);
    transition: opacity 0.2s;
}
.logo-strip:hover img, .logo-strip:hover span { opacity: 0.8; }

/* Page header (panels) */
.page-header {
    margin-bottom: 2rem;
}
.page-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}
.page-header p {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* Spinner */
.spinner {
    border: 3px solid rgba(59, 130, 246, 0.2);
    border-top-color: #3b82f6;
    border-radius: 50%;
    width: 24px; height: 24px;
    animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 640px) {
    .section-title { font-size: 1.75rem; }
    .table-pro { font-size: 0.8125rem; }
}
