@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

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

:root {
    --bg-primary: #05070a;
    --bg-secondary: #0c111d;
    --bg-card: rgba(12, 17, 29, 0.6);
    --bg-glass: rgba(255, 255, 255, 0.02);
    --border: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.15);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #475569;
    --accent-1: #6366f1; /* Indigo */
    --accent-2: #06b6d4; /* Cyan */
    --accent-gradient: linear-gradient(135deg, #6366f1, #06b6d4);
    --accent-gradient-r: linear-gradient(135deg, #06b6d4, #6366f1);
    --danger: #ef4444;
    --success: #10b981;
    --warning: #f59e0b;
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 20px;
    --shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 10px 50px rgba(0, 0, 0, 0.7);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

html { scroll-behavior: smooth; }
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Background effects */
body::before {
    content: '';
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 20%, rgba(139, 92, 246, 0.08) 0%, transparent 50%),
                radial-gradient(circle at 70% 80%, rgba(6, 182, 212, 0.06) 0%, transparent 50%);
    z-index: -1;
    animation: bgShift 20s ease-in-out infinite alternate;
}

@keyframes bgShift {
    0% { transform: translate(0, 0); }
    100% { transform: translate(-5%, 5%); }
}

/* ---- Layout ---- */
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* Doc Content Styles */
.doc-content-area img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius);
    margin: 16px 0;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.doc-content-area video {
    max-width: 100%;
    border-radius: var(--radius);
    margin: 16px 0;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    display: block;
}

.doc-content-area iframe {
    max-width: 100%;
    border-radius: var(--radius);
    margin: 16px 0;
}
.page-wrapper { min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; }

/* ---- Navbar ---- */
.navbar {
    position: sticky; top: 0; z-index: 100;
    background: rgba(5, 7, 10, 0.7);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-bottom: 1px solid var(--border);
}
.navbar .container {
    display: flex; align-items: center; justify-content: space-between;
    height: 72px;
}
.nav-brand {
    font-size: 1.4rem; font-weight: 800;
    background: var(--accent-gradient);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
    text-decoration: none;
    letter-spacing: -0.04em;
}
.nav-links { display: flex; gap: 8px; align-items: center; }
.nav-links a {
    color: var(--text-secondary); text-decoration: none;
    padding: 8px 16px; border-radius: var(--radius-sm);
    font-size: 0.9rem; font-weight: 500;
    transition: var(--transition);
}
.nav-links a:hover { color: var(--text-primary); background: var(--bg-glass); }
.nav-user {
    display: flex; align-items: center; gap: 10px;
    padding: 6px 12px 6px 6px;
    background: var(--bg-glass); border: 1px solid var(--border);
    border-radius: 999px; cursor: pointer; transition: var(--transition);
}
.nav-user:hover { border-color: var(--border-hover); }
.nav-avatar {
    width: 32px; height: 32px; border-radius: 50%;
    object-fit: cover;
}
.nav-username { font-size: 0.85rem; font-weight: 500; }

/* Nav dropdown menu (mobile only) */
.nav-menu-wrap { position: relative; display: none; }
.nav-dropdown {
    display: none;
    position: absolute; top: calc(100% + 8px); right: 0;
    min-width: 180px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 6px;
    z-index: 200;
    animation: slideUp 0.15s ease;
}
.nav-dropdown.show { display: block; }
.nav-dropdown a {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 14px;
    color: var(--text-primary); text-decoration: none;
    font-size: 0.88rem; font-weight: 500;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}
.nav-dropdown a:hover { background: var(--bg-glass); }
.nav-dropdown-divider {
    height: 1px; background: var(--border);
    margin: 4px 0;
}

/* ---- Buttons ---- */
.btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 10px 20px; border-radius: var(--radius-sm);
    font-family: inherit; font-size: 0.9rem; font-weight: 600;
    border: none; cursor: pointer; transition: var(--transition);
    text-decoration: none; white-space: nowrap;
}
.btn:active { transform: scale(0.97); }
.btn-primary {
    background: var(--accent-gradient); color: white;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.3);
}
.btn-primary:hover { 
    box-shadow: 0 8px 30px rgba(99, 102, 241, 0.5); 
    transform: translateY(-2px); 
    filter: brightness(1.1);
}
.btn-secondary {
    background: rgba(255, 255, 255, 0.03); color: var(--text-primary);
    border: 1px solid var(--border);
}
.btn-secondary:hover { 
    border-color: var(--border-hover); 
    background: rgba(255,255,255,0.08); 
    transform: translateY(-1px);
}
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #dc2626; }
.btn-sm { padding: 6px 12px; font-size: 0.8rem; }
.btn-icon { padding: 8px; border-radius: var(--radius-sm); }
.btn-discord {
    background: #5865F2; color: white;
    box-shadow: 0 4px 16px rgba(88, 101, 242, 0.3);
}
.btn-discord:hover { background: #4752c4; box-shadow: 0 6px 24px rgba(88, 101, 242, 0.5); }

/* ---- Cards ---- */
.card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}
.card:hover { 
    border-color: var(--border-hover); 
    box-shadow: var(--shadow);
    transform: translateY(-2px);
}
.card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-hover), transparent);
    opacity: 0; transition: var(--transition);
}
.card:hover::before { opacity: 1; }

.card-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 24px; padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}
.card-title { font-size: 1.2rem; font-weight: 700; letter-spacing: -0.02em; }

/* ---- Inputs ---- */
.input-group { display: flex; flex-direction: column; gap: 6px; }
.input-group label {
    font-size: 0.85rem; font-weight: 500; color: var(--text-secondary);
}
input[type="text"], input[type="email"], input[type="url"], input[type="search"],
input[type="date"], input[type="datetime-local"], select, textarea {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-glass);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit; font-size: 0.9rem;
    transition: var(--transition);
    outline: none;
}
input:focus, select:focus, textarea:focus {
    border-color: var(--accent-1);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
}

select option {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
}

.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 40px !important;
}
input::placeholder { color: var(--text-muted); }

.input-row { display: flex; gap: 12px; align-items: flex-end; }
.input-row .input-group { flex: 1; }

/* ---- Hero ---- */
.hero {
    text-align: center; padding: 120px 0 80px;
    position: relative;
}
.hero h1 {
    font-size: clamp(3rem, 8vw, 5rem); font-weight: 900;
    margin-bottom: 24px; line-height: 1;
    letter-spacing: -0.05em;
}
.hero h1 span {
    background: var(--accent-gradient);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Bending Title Animation */
.bendable-title {
    display: inline-block;
    cursor: pointer;
    transform-origin: left center;
    transform: rotate(4deg) skewY(2deg);
    transition: transform 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
    user-select: none;
    padding-right: 10px;
}

.bendable-title.straightened {
    transform: rotate(0deg) skewY(0deg);
}

.bendable-title:hover:not(.straightened) {
    transform: rotate(6deg) skewY(3deg);
}
.hero p {
    color: var(--text-secondary); font-size: 1.25rem;
    max-width: 600px; margin: 0 auto 48px;
    line-height: 1.6;
    font-weight: 400;
}

/* ---- Shortener Form ---- */
.shortener-card {
    max-width: 800px; margin: 0 auto;
    padding: 48px;
    background: rgba(12, 17, 29, 0.4);
    border: 1px solid var(--border);
    border-radius: 24px;
    backdrop-filter: blur(32px);
    -webkit-backdrop-filter: blur(32px);
    box-shadow: var(--shadow-lg);
    position: relative;
}
.shortener-card::after {
    content: '';
    position: absolute;
    inset: 0; border-radius: 24px;
    padding: 1px;
    background: linear-gradient(135deg, rgba(255,255,255,0.1), transparent, rgba(255,255,255,0.05));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}
.shortener-input-wrap {
    display: flex; gap: 12px; margin-bottom: 16px;
}
.shortener-input-wrap input {
    flex: 1; padding: 16px 24px; font-size: 1.1rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
}
.shortener-options {
    display: flex; gap: 12px; flex-wrap: wrap;
    margin-bottom: 16px;
}
.shortener-options .input-group { flex: 1; min-width: 200px; }
.shortener-result {
    display: none;
    margin-top: 20px; padding: 16px;
    background: rgba(34, 197, 94, 0.08);
    border: 1px solid rgba(34, 197, 94, 0.2);
    border-radius: var(--radius-sm);
}
.shortener-result.show { display: block; animation: slideUp 0.3s ease; }
.shortener-result .short-url {
    font-size: 1.1rem; font-weight: 700;
    color: var(--success); word-break: break-all;
}
.shortener-result .result-row {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px;
}

/* ---- Features ---- */
.features {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px; padding: 60px 0;
}
.feature-card { 
    text-align: left; 
    padding: 40px; 
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.feature-icon {
    font-size: 2rem;
    width: 48px; height: 48px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(99, 102, 241, 0.1);
    border-radius: 12px;
    color: var(--accent-1);
    margin-bottom: 8px;
}
.feature-icon .lucide { margin: 0; width: 24px; height: 24px; }
.feature-card h3 { font-size: 1.25rem; font-weight: 700; color: var(--text-primary); margin: 0; }
.feature-card p { color: var(--text-secondary); font-size: 1rem; line-height: 1.6; margin: 0; }

/* ---- Stats Grid ---- */
.stats-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px; margin-bottom: 24px;
}
.stat-card {
    padding: 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-align: center;
}
.stat-value {
    font-size: 2rem; font-weight: 800;
    background: var(--accent-gradient);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
}
.stat-label { color: var(--text-secondary); font-size: 0.85rem; margin-top: 4px; }

/* ---- Tables ---- */
.table-wrap { overflow-x: auto; border-radius: var(--radius); }
table {
    width: 100%; border-collapse: collapse;
    font-size: 0.88rem;
}
th {
    text-align: left; padding: 12px 16px;
    color: var(--text-secondary); font-weight: 600;
    border-bottom: 1px solid var(--border);
    font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.5px;
}
td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    color: var(--text-primary);
}
tr:hover td { background: var(--bg-glass); }
td .slug { color: var(--accent-2); font-weight: 600; font-family: monospace; }
td .url { color: var(--text-secondary); max-width: 300px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }

/* ---- Badges ---- */
.badge {
    display: inline-block; padding: 3px 10px;
    border-radius: 999px; font-size: 0.75rem; font-weight: 600;
}
.badge-active { background: rgba(34,197,94,0.15); color: var(--success); }
.badge-expired { background: rgba(239,68,68,0.15); color: var(--danger); }
.badge-disabled { background: rgba(100,116,139,0.15); color: var(--text-muted); }
.badge-anonymous { background: rgba(245,158,11,0.15); color: var(--warning); }
.badge-admin { background: rgba(139,92,246,0.15); color: var(--accent-1); }

/* ---- Dashboard Layout ---- */
.dashboard-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 32px 0 24px; flex-wrap: wrap; gap: 16px;
}
.dashboard-header h1 { font-size: 1.8rem; font-weight: 800; }
.dashboard-content { padding-bottom: 60px; }

/* ---- Tabs ---- */
.tabs {
    display: flex; gap: 4px; margin-bottom: 24px;
    background: var(--bg-glass); padding: 4px;
    border-radius: var(--radius-sm); border: 1px solid var(--border);
    width: fit-content;
}
.tab {
    padding: 8px 20px; border-radius: 6px;
    font-size: 0.85rem; font-weight: 500;
    cursor: pointer; transition: var(--transition);
    color: var(--text-secondary); border: none;
    background: transparent; font-family: inherit;
}
.tab:hover { color: var(--text-primary); }
.tab.active {
    background: var(--accent-gradient); color: white;
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.3);
}

/* ---- Pagination ---- */
.pagination {
    display: flex; gap: 8px; justify-content: center;
    margin-top: 24px; align-items: center;
}
.pagination button {
    padding: 8px 14px; border-radius: var(--radius-sm);
    background: var(--bg-glass); border: 1px solid var(--border);
    color: var(--text-primary); cursor: pointer;
    font-family: inherit; font-size: 0.85rem;
    transition: var(--transition);
}
.pagination button:hover:not(:disabled) { border-color: var(--accent-1); }
.pagination button:disabled { opacity: 0.4; cursor: not-allowed; }
.pagination .page-info { font-size: 0.85rem; color: var(--text-secondary); }

/* ---- Chart Container ---- */
.chart-container {
    position: relative; width: 100%;
    background: var(--bg-glass); border-radius: var(--radius);
    padding: 20px; border: 1px solid var(--border);
}
.chart-container canvas { width: 100% !important; }
.charts-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
}

/* ---- Toasts ---- */
.toast-container {
    position: fixed; top: 80px; right: 24px;
    z-index: 9999; display: flex; flex-direction: column; gap: 8px;
}
.toast {
    padding: 14px 20px; border-radius: var(--radius-sm);
    font-size: 0.9rem; font-weight: 500;
    box-shadow: var(--shadow);
    animation: slideIn 0.3s ease, fadeOut 0.3s ease 3s forwards;
    max-width: 400px;
}
.toast-success { background: #065f46; color: #a7f3d0; border: 1px solid rgba(34,197,94,0.3); }
.toast-error { background: #7f1d1d; color: #fca5a5; border: 1px solid rgba(239,68,68,0.3); }
.toast-info { background: #1e3a5f; color: #93c5fd; border: 1px solid rgba(59,130,246,0.3); }

/* ---- Modal ---- */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex; align-items: center; justify-content: center;
    padding: 24px; opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}
.modal-overlay.show { opacity: 1; pointer-events: auto; }
.modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px; max-width: 500px; width: 100%;
    max-height: 90vh; overflow-y: auto;
    box-shadow: var(--shadow-lg);
    transform: translateY(20px);
    transition: transform 0.2s ease;
}
.modal-overlay.show .modal { transform: translateY(0); }
.modal h2 { font-size: 1.3rem; margin-bottom: 20px; }
.modal-actions {
    display: flex; gap: 12px; justify-content: flex-end; margin-top: 24px;
}

/* ---- Empty State ---- */
.empty-state {
    text-align: center; padding: 60px 20px;
    color: var(--text-secondary);
}
.empty-state .icon { font-size: 3rem; margin-bottom: 16px; opacity: 0.5; }
.empty-state h3 { color: var(--text-primary); margin-bottom: 8px; }

/* ---- Footer ---- */
.footer {
    text-align: center; padding: 32px 24px;
    border-top: 1px solid var(--border);
    color: var(--text-muted); font-size: 0.85rem;
    margin-top: auto;
}
.footer-credit { margin-bottom: 12px; }
.footer-credit a { color: var(--text-secondary); text-decoration: none; font-weight: 600; }
.footer-credit a:hover { color: var(--accent-1); text-decoration: underline; }
.footer-links {
    display: flex; justify-content: center; gap: 20px;
    margin-top: 8px;
}
.footer-links a { color: var(--text-muted); text-decoration: none; transition: var(--transition); }
.footer-links a:hover { color: var(--text-primary); }

/* ---- Auth Options ---- */
.checkbox-group {
    display: inline-flex; align-items: center; gap: 10px;
    margin: 12px 0; cursor: pointer; user-select: none;
    font-size: 0.9rem; color: var(--text-secondary);
}
.checkbox-group input {
    width: 18px; height: 18px; border-radius: 4px;
    accent-color: var(--accent-1); cursor: pointer;
}

/* ---- Animations ---- */
@keyframes slideUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideIn { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: translateX(0); } }
@keyframes fadeOut { to { opacity: 0; transform: translateY(-10px); } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }

.animate-in { animation: slideUp 0.4s ease; }
.skeleton { background: var(--bg-glass); animation: pulse 1.5s infinite; border-radius: var(--radius-sm); }

/* ---- Responsive ---- */

/* Tablet */
@media (max-width: 768px) {
    .container { padding: 0 16px; }
    .navbar { border-bottom: 1px solid var(--border); }
    .navbar .container { height: 56px; }
    .nav-brand { font-size: 1.1rem; }

    /* Nav: hide desktop links, show dropdown via avatar */
    .nav-link-desktop { display: none !important; }
    .nav-menu-wrap { display: block; }
    .nav-links { gap: 4px; }
    .nav-username { display: none; }
    .nav-user { padding: 4px; }
    .nav-avatar { width: 32px; height: 32px; }

    /* Hero */
    .hero { padding: 48px 0 32px; }
    .hero p { font-size: 1rem; margin-bottom: 28px; }

    /* Shortener */
    .shortener-card { padding: 20px; }
    .shortener-input-wrap { flex-direction: column; }
    .shortener-input-wrap input { font-size: 16px; /* prevent iOS zoom */ }
    .shortener-input-wrap .btn { width: 100%; justify-content: center; padding: 14px; }
    .shortener-options { flex-direction: column; }
    .shortener-options .input-group { min-width: unset; }
    .shortener-result .result-row { flex-direction: column; align-items: flex-start; gap: 8px; }
    .shortener-result .result-row .btn { width: 100%; justify-content: center; }

    /* Features */
    .features { grid-template-columns: 1fr; gap: 12px; padding: 40px 0; }
    .feature-card { padding: 24px 20px; }

    /* Dashboard */
    .dashboard-header { flex-direction: column; align-items: stretch; padding: 20px 0 16px; gap: 12px; }
    .dashboard-header h1 { font-size: 1.5rem; display: flex; align-items: center; }
    .dashboard-header .btn { width: 100%; justify-content: center; }
    .dashboard-content { padding-bottom: 40px; }

    /* Cards */
    .card { padding: 16px; border-radius: var(--radius); }
    .card-header { flex-direction: column; gap: 12px; align-items: flex-start; }
    .card-header input[type="search"] { width: 100% !important; }

    /* Stats grid */
    .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .stat-card { padding: 14px 10px; }
    .stat-value { font-size: 1.5rem; }
    .stat-label { font-size: 0.75rem; }

    /* Input rows */
    .input-row { flex-direction: column; }
    .input-row .btn { width: 100%; justify-content: center; }

    /* All inputs: prevent iOS zoom */
    input, select, textarea { font-size: 16px !important; }

    /* Tables: allow horizontal scroll and keep layout tidy */
    .table-wrap { margin: 0 -16px; border-radius: 0; border-left: none; border-right: none; }
    table { font-size: 0.8rem; }
    th { padding: 12px 10px; }
    td { padding: 12px 10px; }
    td .url { max-width: 120px; }
    .link-actions { flex-wrap: nowrap; min-width: max-content; }
    .link-actions .btn-sm { padding: 6px 10px; min-height: 32px; }

    /* Tabs */
    .tabs { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .tab { padding: 8px 14px; font-size: 0.8rem; flex-shrink: 0; }

    /* Filter bar */
    .filter-bar { flex-direction: column; }
    .filter-bar input, .filter-bar select { width: 100%; min-width: unset; }

    /* Modal */
    .modal-overlay { padding: 12px; align-items: flex-end; }
    .modal {
        padding: 20px;
        max-width: 100%;
        max-height: 85vh;
        overflow-y: auto;
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    }
    .modal h2 { font-size: 1.1rem; }

    /* Stats modal charts */
    .charts-grid {
        grid-template-columns: 1fr !important;
    }

    /* Toasts */
    .toast-container { left: 16px; right: 16px; top: 68px; }
    .toast { max-width: 100%; }

    /* Chart */
    .chart-container { padding: 12px; }

    /* Pagination */
    .pagination { gap: 6px; }
    .pagination button { padding: 8px 12px; font-size: 0.8rem; }

    /* Footer */
    .footer { padding: 20px 16px; }

    /* Buttons: larger touch targets */
    .btn { padding: 12px 20px; min-height: 44px; }
    .btn-sm { padding: 8px 12px; min-height: 36px; }
}

/* Small phones */
@media (max-width: 480px) {
    .hero h1 { font-size: 2rem; }
    .hero p { font-size: 0.9rem; }

    .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .stat-card { padding: 12px 8px; }
    .stat-value { font-size: 1.3rem; }

    /* Hide less important table columns */
    th:nth-child(5), td:nth-child(5),
    th:nth-child(6), td:nth-child(6) { display: none; }

    .dashboard-header h1 { font-size: 1.4rem; }

    /* Badges */
    .badge { font-size: 0.65rem; padding: 2px 7px; }
}

/* Very small phones */
@media (max-width: 360px) {
    .container { padding: 0 12px; }
    .shortener-card { padding: 16px; }
    .hero { padding: 36px 0 24px; }
    .hero h1 { font-size: 1.7rem; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
}

/* Touch-friendly: no hover effects on touch devices */
@media (hover: none) {
    .btn-primary:hover { transform: none; }
    .card:hover { border-color: var(--border); }
    tr:hover td { background: transparent; }
}

/* Safe area for notched phones */
@supports (padding: env(safe-area-inset-bottom)) {
    .footer { padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
    .modal { padding-bottom: calc(20px + env(safe-area-inset-bottom)); }
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-hover); }

/* Link actions */
.link-actions { display: flex; gap: 6px; }
.link-actions button { font-size: 0.8rem; }

/* Filter bar */
.filter-bar {
    display: flex; gap: 12px; margin-bottom: 20px;
    flex-wrap: wrap; align-items: center;
}
.filter-bar input, .filter-bar select {
    width: auto; min-width: 200px;
}

/* Expiry note */
.expiry-note {
    font-size: 0.8rem; color: var(--text-muted);
    margin-top: 8px; font-style: italic;
}

/* Create form */
.create-form-card { margin-bottom: 24px; }
.create-form {
    display: flex; flex-direction: column; gap: 14px;
}
.create-form-row {
    display: flex; gap: 12px;
}
.create-form-row .input-group { flex: 1; }
.create-form-btn {
    width: 100%; justify-content: center;
    padding: 14px 20px;
}

@media (max-width: 768px) {
    .create-form-row { flex-direction: column; }
}

/* Expiry Progress */
.expiry-visual {
    margin-top: 8px;
    width: 100%;
    max-width: 120px;
}

.progress-container {
    height: 4px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 4px;
}

.progress-bar {
    height: 100%;
    border-radius: 999px;
    transition: width 0.3s ease;
}

.progress-bar.high { background: var(--success); }
.progress-bar.medium { background: var(--warning); }
.progress-bar.low { background: var(--error); }

.expiry-text {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* Icons */
.lucide {
    width: 20px;
    height: 20px;
    vertical-align: middle;
    margin-right: 8px;
    stroke-width: 2px;
    display: inline-block;
    position: relative;
    top: -1px;
}

h1 .lucide { width: 28px; height: 28px; margin-right: 12px; }
h2 .lucide { width: 22px; height: 22px; margin-right: 10px; }
.btn .lucide { width: 18px; height: 18px; margin-right: 6px; vertical-align: middle; }

/* Report Badges */
.badge-pending { background: rgba(245, 158, 11, 0.15); color: var(--warning); }
.badge-reviewed { background: rgba(6, 182, 212, 0.15); color: var(--accent-2); }
.badge-resolved { background: rgba(34, 197, 94, 0.15); color: var(--success); }
.badge-ignored { background: rgba(100, 116, 139, 0.15); color: var(--text-muted); }

/* Admin Reporting */
.highlight-row { background: rgba(139, 92, 246, 0.1) !important; border-left: 3px solid var(--accent-1); }
.admin-select {
    width: auto !important;
    padding: 4px 8px !important;
    font-size: 0.8rem !important;
    height: auto !important;
}

/* Pastebin & Utility Styles */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
.animate-spin, .spin {
    display: inline-block;
    animation: spin 1s linear infinite;
}

pre {
    scrollbar-width: thin;
    scrollbar-color: var(--border) var(--bg-primary);
}
pre::-webkit-scrollbar {
    height: 8px;
}
pre::-webkit-scrollbar-track {
    background: var(--bg-primary);
}
pre::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}
pre::-webkit-scrollbar-thumb:hover {
    background: var(--border-hover);
}

/* --- Premium Paste Editor & Viewer Styles --- */
.editor-card {
    background: rgba(10, 15, 26, 0.7);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: var(--shadow-lg);
    transition: var(--transition);
}
.editor-card:focus-within {
    border-color: var(--accent-1);
    box-shadow: 0 0 25px rgba(99, 102, 241, 0.15);
}
.editor-tab-header {
    background: rgba(6, 9, 15, 0.85);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    flex-wrap: wrap;
    min-height: 48px;
}
.editor-title-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(10, 15, 26, 0.9);
    border-right: 1px solid var(--border);
    padding: 10px 20px;
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 600;
    min-width: 200px;
    flex: 1;
}
.editor-title-input {
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    color: var(--text-primary) !important;
    font-weight: 600;
    font-family: inherit;
    font-size: 0.9rem !important;
    outline: none !important;
    box-shadow: none !important;
    width: 100%;
}
.editor-title-input::placeholder {
    color: var(--text-muted);
}
.editor-controls-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    flex-wrap: wrap;
}
.editor-select-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 2px 8px;
    font-size: 0.8rem;
    transition: var(--transition);
}
.editor-select-wrap:hover {
    border-color: var(--border-hover);
    background: rgba(255, 255, 255, 0.06);
}
.editor-select-wrap select {
    background: transparent !important;
    border: none !important;
    padding: 4px 28px 4px 6px !important;
    font-size: 0.8rem !important;
    height: auto !important;
    width: auto !important;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    box-shadow: none !important;
}
.editor-select-wrap select:focus {
    color: var(--text-primary);
}
.editor-textarea-container {
    position: relative;
    display: flex;
    flex-direction: column;
}
.editor-textarea {
    width: 100%;
    background: #040609 !important;
    border: none !important;
    border-radius: 0 !important;
    color: #e2e8f0;
    font-family: 'Fira Code', Consolas, Monaco, monospace !important;
    font-size: 0.95rem !important;
    line-height: 1.6 !important;
    padding: 20px !important;
    resize: vertical;
    outline: none !important;
    box-shadow: none !important;
    margin: 0;
}
.mobile-helper-bar {
    display: none;
    background: rgba(6, 9, 15, 0.95);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    padding: 6px 12px;
    gap: 6px;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
}
.mobile-helper-bar::-webkit-scrollbar {
    display: none;
}
.helper-key {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-primary);
    padding: 8px 12px;
    font-family: 'Fira Code', Consolas, Monaco, monospace;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    user-select: none;
    min-width: 36px;
    height: 36px;
    transition: var(--transition);
}
.helper-key:active {
    background: var(--accent-1);
    transform: scale(0.9);
}
.editor-footer-status {
    background: rgba(6, 9, 15, 0.85);
    border-top: 1px solid var(--border);
    padding: 8px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}
.editor-status-item {
    display: flex;
    align-items: center;
    gap: 4px;
}
.editor-footer-actions {
    display: flex;
    gap: 8px;
}
.btn-editor-action {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    transition: var(--transition);
}
.btn-editor-action:hover {
    color: var(--text-primary);
    border-color: var(--border-hover);
    background: rgba(255, 255, 255, 0.06);
}
.btn-editor-action.danger-action:hover {
    color: var(--danger);
    border-color: rgba(239, 68, 68, 0.3);
    background: rgba(239, 68, 68, 0.05);
}

/* Premium alert banner */
.premium-alert-banner {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(6, 182, 212, 0.05) 100%);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: var(--radius);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.05);
}

/* Metadata pill styling */
.paste-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}
.meta-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 99px;
    font-size: 0.78rem;
    font-weight: 500;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    transition: var(--transition);
}
.meta-pill:hover {
    border-color: var(--border-hover);
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.04);
}
.meta-pill .lucide {
    width: 14px;
    height: 14px;
    margin-right: 0;
    top: 0;
}
.meta-pill-author {
    background: rgba(99, 102, 241, 0.08);
    border-color: rgba(99, 102, 241, 0.2);
    color: #a5b4fc;
}
.meta-pill-author img {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    object-fit: cover;
}
.meta-pill-expiry {
    background: rgba(245, 158, 11, 0.08);
    border-color: rgba(245, 158, 11, 0.2);
    color: #fde047;
}

/* Code block view with line numbers */
.code-viewer-container {
    display: flex;
    position: relative;
    background: #06080c;
}
.line-numbers-gutter {
    text-align: right;
    padding: 20px 12px 20px 16px;
    border-right: 1px solid var(--border);
    color: var(--text-muted);
    font-family: 'Fira Code', Consolas, Monaco, monospace;
    font-size: 0.92rem;
    line-height: 1.5;
    user-select: none;
    background: #040609;
    min-width: 50px;
}
.code-pre-wrapper {
    flex: 1;
    margin: 0 !important;
    padding: 20px !important;
    overflow-x: auto;
    font-family: 'Fira Code', Consolas, Monaco, monospace;
    font-size: 0.92rem;
    line-height: 1.5;
    background: transparent !important;
}
.code-pre-wrapper code {
    background: transparent !important;
    padding: 0 !important;
    border-radius: 0 !important;
}

/* Word wrap styles */
.word-wrap-enabled .code-pre-wrapper {
    white-space: pre-wrap !important;
    word-break: break-all !important;
}
.word-wrap-enabled .line-numbers-gutter {
    display: none; /* Hide line numbers when word wrap is enabled to avoid line alignment issues */
}

/* Floating/Sticky Mobile Action Bar */
.mobile-sticky-actions {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: rgba(12, 17, 29, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 10px 16px;
    border-radius: 999px;
    display: flex;
    gap: 12px;
    z-index: 990;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(99, 102, 241, 0.2);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    max-width: 90%;
}
.mobile-sticky-actions.show {
    transform: translateX(-50%) translateY(0);
}
.sticky-btn-circle {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition);
}
.sticky-btn-circle:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--border-hover);
}
.sticky-btn-circle:active {
    transform: scale(0.9);
}
.sticky-btn-circle.btn-primary {
    background: var(--accent-gradient);
    border: none;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}
.sticky-btn-circle.btn-primary:hover {
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
}
.sticky-btn-circle .lucide {
    margin-right: 0;
    width: 18px;
    height: 18px;
}

/* Success flash on action buttons */
.btn-success-flash {
    background: rgba(16, 185, 129, 0.15) !important;
    border-color: rgba(16, 185, 129, 0.4) !important;
    color: #34d399 !important;
}

@media (max-width: 768px) {
    .mobile-helper-bar {
        display: flex;
    }
    .editor-title-tab {
        border-right: none;
        border-bottom: 1px solid var(--border);
        min-width: 100%;
    }
    .editor-controls-row {
        width: 100%;
        justify-content: flex-start;
        padding: 10px 16px;
    }
    .editor-select-wrap {
        flex: 1;
    }
    .editor-select-wrap select {
        width: 100% !important;
    }
    
    /* Sticky footer / action bars on mobile view */
    .mobile-hidden {
        display: none !important;
    }
    
    .code-viewer-container {
        border-radius: 0;
    }
    .line-numbers-gutter {
        padding: 16px 8px 16px 12px;
        min-width: 42px;
        font-size: 0.85rem;
    }
    .code-pre-wrapper {
        padding: 16px !important;
        font-size: 0.85rem;
    }
    .paste-header-card {
        padding: 16px !important;
    }
}

/* ---- Language Selector and Help Translate ---- */
.language-selector-wrap {
    display: inline-flex;
    align-items: center;
    gap: 16px;
    margin-top: 20px;
    flex-wrap: wrap;
    justify-content: center;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border);
    padding: 6px 16px;
    border-radius: var(--radius-lg);
    transition: var(--transition);
}

.language-selector-wrap:hover {
    border-color: var(--border-hover);
    background: rgba(255, 255, 255, 0.04);
}

.language-select-container {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
}

.language-select-container select {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    padding: 2px 24px 2px 4px !important;
    width: auto;
    cursor: pointer;
    outline: none;
    box-shadow: none !important;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right center;
    background-size: 12px;
}

.language-select-container select:hover {
    color: var(--text-primary);
}

.translation-help-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    transition: var(--transition);
    border-left: 1px solid var(--border);
    padding-left: 16px;
}

.translation-help-link:hover {
    color: var(--accent-2);
}

.translation-help-link .heart-icon {
    width: 14px;
    height: 14px;
    transition: transform 0.3s ease;
}

.translation-help-link:hover .heart-icon {
    transform: scale(1.2);
    color: #ef4444;
    filter: drop-shadow(0 0 4px rgba(239, 68, 68, 0.5));
}



