@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&family=Poppins:wght@400;600;700&family=Playfair+Display:wght@400;600&family=Space+Mono:wght@400;700&display=swap');

:root {
    --primary: #111827;
    --secondary: #ffffff;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
}

a {
    color: var(--secondary, #93c5fd);
    text-decoration: none;
}

body {
    background: #0f172a;
    color: #e2e8f0;
}

.btn {
    display: inline-block;
    background: var(--secondary, #93c5fd);
    color: var(--primary, #111827);
    padding: 10px 14px;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid rgba(255, 255, 255, 0.15);
    cursor: pointer;
}

.btn:hover {
    filter: brightness(0.95);
}

.btn-sm {
    padding: 6px 10px;
    font-size: 13px;
}

.row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.input {
    width: 100%;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid #334155;
    background: #0a0f1a;
    color: #e2e8f0;
}


.input:focus-visible,
input[type="checkbox"]:focus-visible,
input[type="radio"]:focus-visible,
input[type="file"]:focus-visible,
input[type="color"]:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(147, 197, 253, 0.25);
    border-color: var(--secondary, #93c5fd);
}

input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border: 1px solid #334155;
    border-radius: 4px;
    background: #0a0f1a;
    display: inline-grid;
    place-content: center;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

input[type="checkbox"]::after {
    content: "";
    width: 10px;
    height: 10px;
    clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0, 43% 62%);
    background: var(--primary, #111827);
    transform: scale(0);
    transform-origin: center;
    transition: transform 0.15s ease-in-out;
}

input[type="checkbox"]:checked {
    background: var(--secondary, #93c5fd);
    border-color: var(--secondary, #93c5fd);
}

input[type="checkbox"]:checked::after {
    transform: scale(1);
}

input[type="radio"] {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid #334155;
    border-radius: 50%;
    background: #0a0f1a;
    display: inline-grid;
    place-content: center;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

input[type="radio"]::after {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--secondary, #93c5fd);
    transform: scale(0);
    transition: transform 0.15s ease-in-out;
}

input[type="radio"]:checked {
    border-color: var(--secondary, #93c5fd);
}

input[type="radio"]:checked::after {
    transform: scale(1);
}

.label-row {
    cursor: pointer;
}

.label-row input[type="checkbox"],
.label-row input[type="radio"] {
    margin: 0;
}

input[type="file"] {
    width: 100%;
    padding: 8px;
    border-radius: 8px;
    border: 1px solid #334155;
    background: #0a0f1a;
    color: #cbd5e1;
}

input[type="file"]::file-selector-button {
    margin-right: 10px;
    padding: 8px 12px;
    border: none;
    border-radius: 6px;
    background: var(--secondary, #93c5fd);
    color: var(--primary, #111827);
    font-weight: 600;
    cursor: pointer;
    transition: filter 0.2s ease;
}

input[type="file"]::file-selector-button:hover {
    filter: brightness(0.95);
}

input[type="color"] {
    appearance: none;
    -webkit-appearance: none;
    padding: 0;
    width: 52px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid #334155;
    background: #0a0f1a;
    cursor: pointer;
}

input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
    border-radius: 8px;
}

input[type="color"]::-webkit-color-swatch {
    border: none;
    border-radius: 8px;
}

input[type="color"]::-moz-color-swatch {
    border: none;
    border-radius: 8px;
}

.label {
    font-size: 13px;
    color: #94a3b8;
    margin-bottom: 6px;
    display: block;
}

.icon {
    height: 20px;
    color: var(--secondary);
}

body.page-index .card {
    max-width: 920px;
    margin: 10vh auto;
    background: #111827;
    border: 1px solid #334155;
    border-radius: 12px;
    padding: 24px;
}

body.page-index .panel {
    background: #0b1220;
    border: 1px solid #334155;
    border-radius: 12px;
    padding: 16px;
}

body.page-index input[type=text],
body.page-index input[type=password],
body.page-index select {
    width: 100%;
    padding: 12px 14px;
    border-radius: 8px;
    border: 1px solid #334155;
    background: #0b1220;
    color: #e2e8f0;
}

body.page-index button {
    background: #22c55e;
    color: #0b1220;
    border: none;
    padding: 12px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
}

body.page-index .error {
    color: #fca5a5;
    margin-top: 8px;
}

body.page-index .a {
    color: #93c5fd;
}

body.page-dashboard .container {
    max-width: 1000px;
    margin: 24px auto;
    padding: 0 16px;
}

body.page-dashboard .section {
    background: #0b1220;
    border: 1px solid #334155;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
}

body.page-dashboard .input {
    width: 100%;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid #334155;
    background: #0a0f1a;
    color: #e2e8f0;
}

body.page-dashboard .btn-danger {
    background: #ef4444;
    color: #fff;
}

body.page-dashboard .badge {
    display: inline-block;
    font-size: 12px;
    padding: 2px 6px;
    border-radius: 999px;
    background: #1f2937;
    color: #cbd5e1;
    border: 1px solid #334155;
}

body.page-dashboard .link-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #1f2937;
    gap: 12px;
}

body.page-dashboard .link-left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

body.page-dashboard .stats-row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin: 16px 0;
}

body.page-dashboard .stat-card {
    flex: 1 1 220px;
    background: #0b1220;
    border: 1px solid #334155;
    border-radius: 12px;
    padding: 16px;
}

body.page-dashboard .stat-label {
    font-size: 13px;
    color: #94a3b8;
}

body.page-dashboard .stat-value {
    font-size: 28px;
    font-weight: 700;
    color: #e2e8f0;
}

body.page-dashboard .input-with-copy {
    display: flex;
    gap: 0;
}

body.page-dashboard .input-with-copy .input {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    flex: 1;
}

body.page-dashboard .copy-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 12px;
    background: var(--secondary, #93c5fd);
    color: var(--primary, #111827);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-left: none;
    border-radius: 0 8px 8px 0;
    cursor: pointer;
    transition: filter 0.2s ease;
}

body.page-dashboard .copy-btn:hover {
    filter: brightness(0.95);
}

body.page-dashboard .copy-btn.copied {
    background: #22c55e;
    color: #fff;
}

body.page-dashboard .qr-btn {
    border-radius: 0;
    border-left: 1px solid rgba(0,0,0,0.1);
}

body.page-dashboard .input-with-copy .copy-btn:last-child {
    border-radius: 0 8px 8px 0;
}

body.page-dashboard .short-links-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

body.page-dashboard .short-link-item {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    padding: 12px;
    border: 1px solid #1f2937;
    border-radius: 10px;
    background: rgba(15, 23, 42, 0.6);
}

body.page-dashboard .short-link-meta {
    flex: 1 1 260px;
    min-width: 260px;
}

body.page-dashboard .short-link-url-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

body.page-dashboard .copy-icon {
    display: inline-flex;
    align-items: center;
    color: #94a3b8;
    cursor: pointer;
    transition: color 0.2s ease;
}

body.page-dashboard .copy-icon:hover {
    color: var(--secondary, #93c5fd);
}

body.page-dashboard .copy-icon.copied {
    color: #22c55e;
}

body.page-profile {
    background: var(--primary);
    color: var(--secondary);
    min-height: 100vh;
}

body.page-profile .banner {
    width: 100%;
    height: 220px;
    background: #0b1220;
    background-position: center;
    background-size: cover;
}

body.page-profile .container {
    margin: 0 16px;
}

body.page-profile .card {
    max-width: 760px;
    margin: -60px auto 24px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    padding: 16px;
    backdrop-filter: blur(6px);
}

body.page-profile .avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: #111;
    object-fit: cover;
}

body.page-profile .name {
    font-size: 28px;
    font-weight: 800;
    margin: 8px 0 2px 0;
}

body.page-profile .username {
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
}

body.page-profile .about {
    margin-top: 12px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.9);
}

body.page-profile .links {
    margin-top: 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

body.page-profile .link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 10px;
    color: var(--secondary);
    text-decoration: none;
    background: rgba(255, 255, 255, 0.06);
}

body.page-profile .link:hover {
    background: rgba(255, 255, 255, 0.12);
}

.mt-0 {
    margin-top: 0 !important;
}

.mt-6 {
    margin-top: 6px !important;
}

.mt-8 {
    margin-top: 8px !important;
}

.mt-10 {
    margin-top: 10px !important;
}

.mt-12 {
    margin-top: 12px !important;
}

.mt-16 {
    margin-top: 16px !important;
}

.my-8 {
    margin-top: 8px !important;
    margin-bottom: 8px !important;
}

.my-12 {
    margin-top: 12px !important;
    margin-bottom: 12px !important;
}

.my-0 {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

.my-8 {
    margin-top: 8px !important;
    margin-bottom: 8px !important;
}

.my-6 {
    margin-top: 6px !important;
    margin-bottom: 6px !important;
}

.fw-600 {
    font-weight: 600;
}

.fw-700 {
    font-weight: 700;
}

.text-sm {
    font-size: 14px;
}

.text-muted {
    color: #94a3b8;
}

.text-subtle {
    color: #cbd5e1;
}

.text-light {
    color: #e5e7eb;
}

.text-ellipsis {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.capitalize {
    text-transform: capitalize;
}

.hidden {
    display: none !important;
}

body.page-profile.font-system {
    font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
}

body.page-profile.font-inter {
    font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
}

body.page-profile.font-poppins {
    font-family: 'Poppins', ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
}

body.page-profile.font-playfair {
    font-family: 'Playfair Display', 'Times New Roman', Times, serif;
}

body.page-profile.font-space-mono {
    font-family: 'Space Mono', 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
}

.items-center {
    align-items: center !important;
}

.items-end {
    align-items: flex-end !important;
}

.justify-between {
    justify-content: space-between !important;
}

.gap-8 {
    gap: 8px !important;
}

.gap-12 {
    gap: 12px !important;
}

.gap-16 {
    gap: 16px !important;
}

.flex-wrap {
    flex-wrap: wrap !important;
}

.nowrap {
    flex-wrap: nowrap !important;
}

.flex-1 {
    flex: 1 1 0%;
}

.min-w-0 {
    min-width: 0;
}

.min-w-180 {
    min-width: 180px;
}

.min-w-220 {
    min-width: 220px;
}

.min-w-240 {
    min-width: 240px;
}

.min-w-260 {
    min-width: 260px;
}

.min-w-280 {
    min-width: 280px;
}

.h-6 {
    height: 6px;
}

.h-8 {
    height: 8px;
}

.h-10 {
    height: 10px;
}

.resize-vertical {
    resize: vertical;
}

.link-blue {
    color: #93c5fd;
    text-decoration: none;
}

.avatar-img {
    width: 120px;
    height: 120px;
    border-radius: 8px;
    background: #111;
    object-fit: cover;
}

.banner-preview {
    width: 100%;
    height: 120px;
    border-radius: 8px;
    background: #0b1220;
    background-size: cover;
    background-position: center;
}

.uselect{
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.label-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.alert-error {
    border-color: #ef4444 !important;
    color: #fecaca !important;
}

.alert-success {
    border-color: #22c55e !important;
    color: #bbf7d0 !important;
}

.flex-2 {
    flex: 2 1 0% !important;
}

/* Analytics Page Styles */
.analytics-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.analytics-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.analytics-table th,
.analytics-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #1e293b;
}

.analytics-table th {
    background: #0a0f1a;
    color: #94a3b8;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.analytics-table tbody tr:hover {
    background: rgba(148, 163, 184, 0.05);
}

.analytics-table td {
    color: #e2e8f0;
}

.stat-sub {
    font-size: 12px;
    color: #64748b;
    margin-top: 4px;
}

.min-w-150 {
    min-width: 150px;
}

.gap-16 {
    gap: 16px !important;
}