/* kurzz.link - Dark Theme URL Shortener */

:root {
    --color-primary: #e94560;
    --color-primary-hover: #d63851;
    --color-bg: #1a1a2e;
    --color-bg-alt: #16213e;
    --color-surface: rgba(255,255,255,0.06);
    --color-surface-hover: rgba(255,255,255,0.1);
    --color-text: #f0f0f0;
    --color-text-muted: rgba(255,255,255,0.45);
    --color-border: rgba(255,255,255,0.1);
    --color-border-focus: rgba(233,69,96,0.5);
    --color-success: #10b981;
    --color-success-bg: rgba(16,185,129,0.12);
    --color-error: #ff6b6b;
    --color-error-bg: rgba(255,107,107,0.12);
    --radius: 8px;
    --radius-lg: 12px;
    --max-width: 800px;
    --shadow: 0 2px 8px rgba(0,0,0,0.3);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.4);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, var(--color-bg) 0%, var(--color-bg-alt) 100%);
    background-attachment: fixed;
    color: var(--color-text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color 0.15s;
}

a:hover {
    color: var(--color-primary-hover);
    text-decoration: underline;
}

/* Layout */
.container {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1rem;
}

main {
    flex: 1;
    padding: 2rem 0;
}

/* Navigation */
.nav {
    background: rgba(22,33,62,0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--color-border);
    padding: 0.75rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1000px;
}

.nav-logo {
    font-size: 1.25rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.nav-logo::before {
    content: '';
    display: inline-block;
    width: 22px;
    height: 22px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23e94560' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71'/%3E%3Cpath d='M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
}

.nav-logo:hover {
    text-decoration: none;
    color: var(--color-primary);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 1rem;
    list-style: none;
}

.nav-links a {
    color: var(--color-text-muted);
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius);
    transition: color 0.15s;
}

.nav-links a:hover {
    color: #fff;
    text-decoration: none;
}

.nav-links a.active {
    color: var(--color-primary);
}

/* Language Switcher */
.lang-switcher {
    position: relative;
}

.lang-switcher select {
    appearance: none;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 0.25rem 1.5rem 0.25rem 0.5rem;
    font-size: 0.8rem;
    color: var(--color-text-muted);
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='rgba(255,255,255,0.4)' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.4rem center;
}

.lang-switcher select:focus {
    outline: none;
    border-color: var(--color-primary);
}

.lang-switcher select option {
    background: var(--color-bg-alt);
    color: var(--color-text);
}

/* Cards */
.card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

/* Forms */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="url"],
input[type="number"],
textarea,
select {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    font-size: 0.9375rem;
    color: var(--color-text);
    background: rgba(255,255,255,0.06);
    transition: border-color 0.15s, box-shadow 0.15s;
}

input::placeholder,
textarea::placeholder {
    color: var(--color-text-muted);
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(233,69,96,0.15);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.625rem 1.25rem;
    border: none;
    border-radius: var(--radius);
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
    text-decoration: none;
}

.btn:hover {
    text-decoration: none;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: var(--color-primary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--color-primary-hover);
    color: #fff;
}

.btn-secondary {
    background: var(--color-surface);
    color: var(--color-text);
    border: 1px solid var(--color-border);
}

.btn-secondary:hover {
    background: var(--color-surface-hover);
    color: #fff;
}

.btn-danger {
    background: rgba(255,107,107,0.15);
    color: var(--color-error);
    border: 1px solid rgba(255,107,107,0.25);
}

.btn-danger:hover {
    background: rgba(255,107,107,0.25);
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
}

.btn-block {
    width: 100%;
}

/* URL Shortener Form */
.shorten-form {
    display: flex;
    gap: 0.5rem;
}

.shorten-form input[type="url"] {
    flex: 1;
    font-size: 1rem;
    padding: 0.75rem 1rem;
}

.shorten-form .btn {
    padding: 0.75rem 1.5rem;
    white-space: nowrap;
}

/* Home Hero */
.hero {
    text-align: center;
    padding: 3rem 0 2rem;
}

.hero h1 {
    font-size: 2.25rem;
    font-weight: 800;
    letter-spacing: -1px;
    margin-bottom: 0.5rem;
    color: #fff;
}

.hero p {
    color: var(--color-text-muted);
    font-size: 1.125rem;
    margin-bottom: 2rem;
}

/* Result */
.result-box {
    text-align: center;
    padding: 1.5rem;
    background: var(--color-success-bg);
    border: 1px solid rgba(16,185,129,0.25);
    border-radius: var(--radius-lg);
    margin: 1.5rem 0;
}

.result-url {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-primary);
    word-break: break-all;
    margin: 0.75rem 0;
}

.result-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin-top: 1rem;
}

/* Flash Messages */
.flash {
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    font-size: 0.875rem;
    font-weight: 500;
}

.flash-error {
    background: var(--color-error-bg);
    color: var(--color-error);
    border: 1px solid rgba(255,107,107,0.25);
}

.flash-success {
    background: var(--color-success-bg);
    color: var(--color-success);
    border: 1px solid rgba(16,185,129,0.25);
}

/* Tables */
.table-wrap {
    overflow-x: auto;
}

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

th, td {
    text-align: left;
    padding: 0.75rem;
    border-bottom: 1px solid var(--color-border);
    font-size: 0.875rem;
}

th {
    font-weight: 600;
    color: var(--color-text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

td a {
    word-break: break-all;
}

.original-url {
    max-width: 250px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1.25rem;
    text-align: center;
    backdrop-filter: blur(8px);
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--color-primary);
    line-height: 1;
}

.stat-card .stat-label {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 0.25rem;
}

/* Chart */
.chart-container {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    backdrop-filter: blur(8px);
}

.chart-bar {
    display: flex;
    align-items: end;
    gap: 2px;
    height: 150px;
    padding-top: 1rem;
}

.chart-bar .bar {
    flex: 1;
    background: var(--color-primary);
    border-radius: 2px 2px 0 0;
    min-height: 2px;
    position: relative;
    transition: opacity 0.15s;
}

.chart-bar .bar:hover {
    opacity: 0.75;
}

.chart-labels {
    display: flex;
    gap: 2px;
    margin-top: 0.25rem;
}

.chart-labels span {
    flex: 1;
    text-align: center;
    font-size: 0.6rem;
    color: var(--color-text-muted);
}

/* Footer */
.footer {
    padding: 1.5rem 0;
    border-top: 1px solid var(--color-border);
    text-align: center;
    font-size: 0.8125rem;
    color: var(--color-text-muted);
}

.footer a {
    color: var(--color-text-muted);
    margin: 0 0.75rem;
}

.footer a:hover {
    color: #fff;
}

/* Auth Forms */
.auth-container {
    max-width: 400px;
    margin: 2rem auto;
}

.auth-container h1 {
    text-align: center;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    color: #fff;
}

.auth-footer {
    text-align: center;
    margin-top: 1rem;
    font-size: 0.875rem;
    color: var(--color-text-muted);
}

/* Admin */
.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.badge {
    display: inline-block;
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-on {
    background: var(--color-success-bg);
    color: var(--color-success);
}

.badge-off {
    background: var(--color-surface);
    color: var(--color-text-muted);
}

/* Interstitial */
.interstitial {
    text-align: center;
    max-width: 500px;
    margin: 4rem auto;
}

.interstitial h1 {
    margin-bottom: 1rem;
    color: #fff;
}

.interstitial .target-url {
    word-break: break-all;
    color: var(--color-text-muted);
    margin: 1rem 0;
    font-size: 0.875rem;
}

.interstitial .countdown {
    font-size: 0.875rem;
    color: var(--color-text-muted);
    margin-top: 1.5rem;
}

/* 404 */
.error-page {
    text-align: center;
    padding: 4rem 0;
}

.error-page h1 {
    font-size: 4rem;
    font-weight: 800;
    color: rgba(255,255,255,0.1);
}

.error-page p {
    color: var(--color-text-muted);
    margin: 0.5rem 0 1.5rem;
}

/* Dashboard embed code textareas */
.card textarea[readonly] {
    background: rgba(0,0,0,0.25) !important;
    color: var(--color-text-muted) !important;
    border-color: var(--color-border) !important;
}

/* Code blocks */
code {
    background: rgba(255,255,255,0.08);
    padding: 0.125rem 0.375rem;
    border-radius: 4px;
    font-size: 0.875em;
    color: var(--color-primary);
}

/* Utilities */
.text-center { text-align: center; }
.text-muted { color: var(--color-text-muted); }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

/* RTL Support */
[dir="rtl"] .nav .container {
    flex-direction: row-reverse;
}

[dir="rtl"] .nav-links {
    flex-direction: row-reverse;
}

[dir="rtl"] th, [dir="rtl"] td {
    text-align: right;
}

[dir="rtl"] .shorten-form {
    flex-direction: row-reverse;
}

/* Responsive */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 1.75rem;
    }

    .shorten-form {
        flex-direction: column;
    }

    .nav .container {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .nav-links {
        gap: 0.5rem;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .card {
        padding: 1.25rem;
    }

    .result-actions {
        flex-direction: column;
    }

    [dir="rtl"] .shorten-form {
        flex-direction: column;
    }
}
