/* =============================================================================
   X2Y URL Shortener — Style Sheet
   Design: Modern glassmorphism, Inter font, vibrant blue palette
   ============================================================================= */

/* ── CSS Variables ─────────────────────────────────────────────────────────── */
:root {
    --x2y-primary:        #0066ff;
    --x2y-primary-dark:   #0047cc;
    --x2y-primary-light:  #e8f0ff;
    --x2y-accent:         #00c9a7;
    --x2y-accent-dark:    #00a88d;
    --x2y-danger:         #ff3b5c;
    --x2y-warning:        #ffb400;
    --x2y-dark:           #0d1117;
    --x2y-gray-900:       #1a1f2e;
    --x2y-gray-800:       #2d3444;
    --x2y-gray-700:       #4a5568;
    --x2y-gray-600:       #718096;
    --x2y-gray-400:       #a0aec0;
    --x2y-gray-200:       #e2e8f0;
    --x2y-gray-100:       #f7f9fc;
    --x2y-white:          #ffffff;
    --x2y-shadow-sm:      0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.05);
    --x2y-shadow:         0 4px 16px rgba(0,0,0,0.10);
    --x2y-shadow-lg:      0 10px 40px rgba(0,0,0,0.14);
    --x2y-radius:         12px;
    --x2y-radius-sm:      8px;
    --x2y-radius-lg:      20px;
    --x2y-transition:     all 0.22s cubic-bezier(.4,0,.2,1);
}

/* ── Base Reset ────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
    font-size: 16px;
    color: var(--x2y-gray-700);
    background: var(--x2y-gray-100);
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
}

@media (max-width: 1024px) { html, body { font-size: 15px; } }
@media (max-width: 768px)  { html, body { font-size: 14px; } }
@media (max-width: 576px)  { html, body { font-size: 13px; } }

a { text-decoration: none !important; transition: var(--x2y-transition); }
a:hover { opacity: 0.85; }

.container { max-width: 1320px !important; width: 100%; }

/* ── Header ─────────────────────────────────────────────────────────────── */
header {
    background: var(--x2y-white);
    box-shadow: 0 2px 12px rgba(0,102,255,0.08);
    position: sticky;
    top: 0;
    z-index: 1040;
}

header .top {
    background: linear-gradient(90deg, var(--x2y-primary) 0%, var(--x2y-primary-dark) 100%);
    font-size: 12px;
    padding: 0.5rem 0;
    color: var(--x2y-white);
}

header .top .contact span {
    display: inline-block;
    margin: 0 1rem;
}
header .top .contact a { color: var(--x2y-white); }
header .top .contact a:hover { color: rgba(255,255,255,0.75); opacity: 1; }
header .top .contact i { margin-right: 0.4rem; }

header .mid {
    padding: 0.9rem 15px;
}

header .mid .logo { max-width: 260px; }
header .mid .logo img { max-height: 52px; width: auto; }

/* Desktop Nav */
@media (min-width: 992px) {
    header .mid .nav li { margin-left: 1.5rem; }
    header .mid .nav li a:not(.btn) {
        color: var(--x2y-gray-700);
        font-weight: 500;
        font-size: 0.9rem;
        padding: 0.35rem 0;
        border-bottom: 2px solid transparent;
        display: inline-block;
    }
    header .mid .nav li a:not(.btn):hover,
    header .mid .nav li a:not(.btn).nav-active {
        color: var(--x2y-primary);
        border-bottom-color: var(--x2y-primary);
        opacity: 1;
    }
    header .mid .nav li .dropdown-menu {
        font-size: 0.875rem;
        padding: 0.75rem;
        border: none;
        box-shadow: var(--x2y-shadow-lg);
        border-radius: var(--x2y-radius);
        min-width: 180px;
    }
    header .mid .nav li .dropdown-menu a {
        padding: 0.5rem 0.75rem;
        border-radius: var(--x2y-radius-sm);
        display: block;
        color: var(--x2y-gray-700);
        border-bottom: none;
    }
    header .mid .nav li .dropdown-menu a:hover {
        background: var(--x2y-primary-light);
        color: var(--x2y-primary);
        opacity: 1;
    }
}

/* Mobile Nav */
@media (max-width: 991px) {
    header .mid .nav {
        position: fixed;
        left: -100%;
        top: 0;
        width: 72%;
        max-width: 300px;
        height: 100%;
        background: var(--x2y-white);
        box-shadow: 4px 0 20px rgba(0,0,0,0.15);
        z-index: 1070;
        padding: 2rem 1.25rem;
        flex-direction: column;
        transition: left 0.3s ease;
        overflow-y: auto;
    }
    header .mid .nav.open { left: 0; }
    header .mid .nav li { border-bottom: 1px solid var(--x2y-gray-200); }
    header .mid .nav li + li { margin-top: 0; }
    header .mid .nav li > a:not(.btn) {
        font-size: 1rem;
        font-weight: 500;
        line-height: 2.5;
        color: var(--x2y-gray-700);
        display: block;
    }
    header .mid .nav li .dropdown-menu {
        position: relative;
        left: 0;
        top: 0;
        width: 100%;
        border: 0;
        box-shadow: none;
        padding-left: 1rem;
    }
    header .mid .nav li .dropdown-menu a {
        padding: 0;
        line-height: 2.2;
        display: block;
        color: var(--x2y-gray-600);
    }
}

.mask {
    position: fixed;
    left: 0; top: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.45);
    z-index: 1060;
    display: none;
}

/* ── Hero Section ────────────────────────────────────────────────────────── */
.x2y-hero {
    background: linear-gradient(135deg, #0047cc 0%, #0066ff 40%, #00c9a7 100%);
    color: var(--x2y-white);
    padding: 5rem 0 4rem;
    position: relative;
    overflow: hidden;
}

.x2y-hero::before {
    content: '';
    position: absolute;
    top: -40%;
    right: -10%;
    width: 600px;
    height: 600px;
    background: rgba(255,255,255,0.06);
    border-radius: 50%;
    pointer-events: none;
}

.x2y-hero::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -5%;
    width: 400px;
    height: 400px;
    background: rgba(255,255,255,0.04);
    border-radius: 50%;
    pointer-events: none;
}

.x2y-hero h1 { font-size: clamp(2rem, 5vw, 3.5rem); font-weight: 800; line-height: 1.1; }
.x2y-hero p.lead { font-size: 1.15rem; opacity: 0.9; max-width: 560px; }

/* Glassmorphism URL input card */
.hero-card {
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.25);
    border-radius: var(--x2y-radius-lg);
    padding: 2rem;
    box-shadow: 0 8px 32px rgba(0,0,0,0.18);
}

/* ── Feature Cards ───────────────────────────────────────────────────────── */
.feature-card {
    background: var(--x2y-white);
    border-radius: var(--x2y-radius);
    padding: 2rem 1.5rem;
    text-align: center;
    box-shadow: var(--x2y-shadow-sm);
    border: 1px solid var(--x2y-gray-200);
    transition: var(--x2y-transition);
    height: 100%;
}
.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--x2y-shadow-lg);
    border-color: var(--x2y-primary-light);
}
.feature-icon {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    background: var(--x2y-primary-light);
    color: var(--x2y-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    margin: 0 auto 1.25rem;
    transition: var(--x2y-transition);
}
.feature-card:hover .feature-icon {
    background: var(--x2y-primary);
    color: var(--x2y-white);
}

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn { font-weight: 600; letter-spacing: 0.01em; border-radius: var(--x2y-radius-sm); transition: var(--x2y-transition); }
.btn:hover { transform: translateY(-1px); box-shadow: var(--x2y-shadow); }
.btn:active { transform: translateY(0); }

.btn-x2y {
    background: linear-gradient(135deg, var(--x2y-primary) 0%, var(--x2y-primary-dark) 100%);
    color: var(--x2y-white);
    border: 2px solid transparent;
    padding: 0.6rem 1.5rem;
}
.btn-x2y:hover { color: var(--x2y-white); box-shadow: 0 6px 20px rgba(0,102,255,0.4); }

.btn-x2y-outline {
    background: transparent;
    color: var(--x2y-primary);
    border: 2px solid var(--x2y-primary);
    padding: 0.6rem 1.5rem;
}
.btn-x2y-outline:hover { background: var(--x2y-primary); color: var(--x2y-white); }

/* ── Cards & Panels ──────────────────────────────────────────────────────── */
.x2y-card {
    background: var(--x2y-white);
    border-radius: var(--x2y-radius);
    box-shadow: var(--x2y-shadow-sm);
    border: 1px solid var(--x2y-gray-200);
}

.x2y-section { padding: 4rem 0; }
.x2y-section-title {
    font-size: 2rem;
    font-weight: 800;
    color: var(--x2y-gray-900);
    margin-bottom: 0.5rem;
}
.x2y-section-sub { color: var(--x2y-gray-600); font-size: 1.05rem; margin-bottom: 2.5rem; }

/* ── Forms ───────────────────────────────────────────────────────────────── */
.form-control, .form-select {
    border-radius: var(--x2y-radius-sm);
    border: 1.5px solid var(--x2y-gray-200);
    padding: 0.65rem 1rem;
    font-size: 0.95rem;
    transition: var(--x2y-transition);
    background: var(--x2y-white);
}
.form-control:focus, .form-select:focus {
    border-color: var(--x2y-primary);
    box-shadow: 0 0 0 3px rgba(0,102,255,0.12);
    outline: none;
}

.input-group-text {
    background: var(--x2y-gray-100);
    border: 1.5px solid var(--x2y-gray-200);
    color: var(--x2y-gray-600);
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: var(--x2y-radius-sm) 0 0 var(--x2y-radius-sm);
}

/* ── Tables ──────────────────────────────────────────────────────────────── */
.table { font-size: 0.9rem; }
.table thead th { background: var(--x2y-gray-900); color: var(--x2y-white); font-weight: 600; border: none; padding: 0.85rem 1rem; }
.table tbody tr { transition: var(--x2y-transition); }
.table tbody tr:hover { background: var(--x2y-primary-light); }
.table td { vertical-align: middle; padding: 0.75rem 1rem; border-color: var(--x2y-gray-200); }

/* ── Badges ──────────────────────────────────────────────────────────────── */
.badge { font-weight: 600; letter-spacing: 0.03em; border-radius: 6px; }
.badge-status-active    { background: #d1fae5; color: #065f46; }
.badge-status-pending   { background: #fef3c7; color: #92400e; }
.badge-status-suspended { background: #fee2e2; color: #991b1b; }
.badge-role-admin { background: #ede9fe; color: #5b21b6; }
.badge-role-user  { background: var(--x2y-gray-200); color: var(--x2y-gray-700); }

/* ── API Key Styles ──────────────────────────────────────────────────────── */
.api-key-box {
    background: var(--x2y-gray-900);
    color: #7ee787;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    padding: 0.6rem 1rem;
    border-radius: var(--x2y-radius-sm);
    word-break: break-all;
    letter-spacing: 0.04em;
}
.api-key-card {
    background: var(--x2y-white);
    border: 1px solid var(--x2y-gray-200);
    border-radius: var(--x2y-radius);
    padding: 1.25rem;
    transition: var(--x2y-transition);
}
.api-key-card:hover { border-color: var(--x2y-primary); box-shadow: var(--x2y-shadow-sm); }
.api-key-status-active  { border-left: 4px solid var(--x2y-accent); }
.api-key-status-revoked { border-left: 4px solid var(--x2y-gray-400); opacity: 0.65; }

/* ── URL List ────────────────────────────────────────────────────────────── */
.url-list-item {
    background: var(--x2y-white);
    border: 1px solid var(--x2y-gray-200);
    border-radius: var(--x2y-radius);
    padding: 1rem 1.25rem;
    transition: var(--x2y-transition);
}
.url-list-item:hover { border-color: var(--x2y-primary); box-shadow: var(--x2y-shadow-sm); }

/* ── QR Code ─────────────────────────────────────────────────────────────── */
.qr-thumb { border-radius: 8px; border: 2px solid var(--x2y-gray-200); transition: var(--x2y-transition); }
.qr-thumb:hover { border-color: var(--x2y-primary); transform: scale(1.1); }

/* ── Analytics ───────────────────────────────────────────────────────────── */
.stat-card {
    background: var(--x2y-white);
    border-radius: var(--x2y-radius);
    padding: 1.5rem;
    box-shadow: var(--x2y-shadow-sm);
    border: 1px solid var(--x2y-gray-200);
    text-align: center;
}
.stat-card .stat-number { font-size: 2.5rem; font-weight: 800; color: var(--x2y-primary); line-height: 1; }
.stat-card .stat-label  { font-size: 0.85rem; color: var(--x2y-gray-600); font-weight: 500; margin-top: 0.3rem; }
.stat-card .stat-icon   { font-size: 1.5rem; margin-bottom: 0.5rem; }

.chart-container { position: relative; background: var(--x2y-white); border-radius: var(--x2y-radius); padding: 1.5rem; box-shadow: var(--x2y-shadow-sm); }

/* Device breakdown bars */
.device-bar { height: 8px; border-radius: 4px; }
.device-bar-desktop { background: var(--x2y-primary); }
.device-bar-mobile  { background: var(--x2y-accent); }
.device-bar-bot     { background: var(--x2y-gray-400); }

/* ── Auth Pages ──────────────────────────────────────────────────────────── */
.auth-container { margin: 3rem auto; }
.auth-container .card {
    max-width: 520px;
    margin: 0 auto;
    border: none;
    border-radius: var(--x2y-radius-lg);
    box-shadow: var(--x2y-shadow-lg);
}
.nav-tabs .nav-link {
    font-weight: 600;
    color: var(--x2y-gray-600);
    border: none;
    padding: 0.75rem 1.25rem;
    border-radius: 0;
}
.nav-tabs .nav-link.active {
    color: var(--x2y-primary);
    border-bottom: 3px solid var(--x2y-primary);
    background: transparent;
}
@media (max-width: 576px) { .auth-container { margin: 1.5rem 1rem; } }

/* ── Profile ─────────────────────────────────────────────────────────────── */
.profile-header {
    background: linear-gradient(135deg, var(--x2y-primary) 0%, var(--x2y-primary-dark) 100%);
    color: var(--x2y-white);
    padding: 2.5rem 2rem;
    border-radius: var(--x2y-radius) var(--x2y-radius) 0 0;
}
.profile-nav .nav-link {
    color: var(--x2y-gray-700);
    font-weight: 500;
    padding: 0.7rem 1rem;
    border-radius: var(--x2y-radius-sm);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.profile-nav .nav-link:hover { background: var(--x2y-primary-light); color: var(--x2y-primary); }
.profile-nav .nav-link.active { background: var(--x2y-primary-light); color: var(--x2y-primary); font-weight: 600; }

/* ── Admin Panel ─────────────────────────────────────────────────────────── */
.admin-stat-box {
    background: linear-gradient(135deg, var(--x2y-primary) 0%, var(--x2y-primary-dark) 100%);
    color: var(--x2y-white);
    border-radius: var(--x2y-radius);
    padding: 1.5rem;
    text-align: center;
}
.admin-stat-box.accent { background: linear-gradient(135deg, var(--x2y-accent) 0%, var(--x2y-accent-dark) 100%); }
.admin-stat-box.warning { background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%); }
.admin-stat-box.danger  { background: linear-gradient(135deg, var(--x2y-danger) 0%, #cc2244 100%); }
.admin-stat-box .stat-val  { font-size: 2.5rem; font-weight: 800; }
.admin-stat-box .stat-lbl  { font-size: 0.85rem; opacity: 0.85; }

/* ── Footer ──────────────────────────────────────────────────────────────── */
footer {
    background: linear-gradient(135deg, var(--x2y-gray-900) 0%, var(--x2y-dark) 100%);
    color: rgba(255,255,255,0.8);
    padding: 1.5rem 0;
}
footer .copyright { font-size: 0.85rem; padding: 0.5rem 0; }
footer .copyright a { color: rgba(255,255,255,0.6); }
footer .copyright a:hover { color: var(--x2y-white); opacity: 1; }

@media (max-width: 576px) {
    footer { padding: 1rem 0; margin-bottom: 55px; }
}

/* Mobile Bottom Nav */
#botNav {
    padding: 8px 0;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.15);
    background: linear-gradient(135deg, var(--x2y-primary) 0%, var(--x2y-primary-dark) 100%);
}
#botNav a {
    display: block;
    width: 25%;
    text-align: center;
    color: var(--x2y-white);
    font-size: 0.7rem;
}
#botNav a span { display: block; font-size: 1.1rem; margin-bottom: 2px; }

/* ── Scroll to Top ───────────────────────────────────────────────────────── */
#scroll-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    display: none;
    z-index: 1050;
    width: 46px;
    height: 46px;
    padding: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: var(--x2y-primary);
    color: var(--x2y-white);
    border: none;
    border-radius: 50%;
    box-shadow: var(--x2y-shadow);
    transition: var(--x2y-transition);
}
#scroll-to-top:hover { background: var(--x2y-primary-dark); transform: translateY(-3px); }

/* ── Alerts / Notices ────────────────────────────────────────────────────── */
.x2y-alert-pending {
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: var(--x2y-radius-sm);
    padding: 0.85rem 1.1rem;
    color: #92400e;
    font-size: 0.9rem;
}
.x2y-alert-pending i { color: #f59e0b; }

/* ── Code blocks (API docs) ──────────────────────────────────────────────── */
.code-block {
    background: var(--x2y-gray-900);
    color: #7ee787;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    padding: 1rem 1.25rem;
    border-radius: var(--x2y-radius-sm);
    overflow-x: auto;
    line-height: 1.6;
}
.code-block .code-comment { color: var(--x2y-gray-400); }
.code-block .code-key     { color: #79c0ff; }
.code-block .code-val     { color: #ff7b72; }

/* ── Utilities ───────────────────────────────────────────────────────────── */
.text-primary-x2y { color: var(--x2y-primary) !important; }
.bg-primary-x2y   { background-color: var(--x2y-primary) !important; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.fw-800 { font-weight: 800; }
.rounded-x2y { border-radius: var(--x2y-radius) !important; }
.shadow-x2y   { box-shadow: var(--x2y-shadow) !important; }

/* Pulse animation for loading states */
@keyframes x2y-pulse { 0%,100% { opacity:1; } 50% { opacity:.5; } }
.x2y-loading { animation: x2y-pulse 1.5s ease-in-out infinite; }

/* Fade-in animation for dynamic content */
@keyframes x2y-fadein { from { opacity:0; transform:translateY(10px); } to { opacity:1; transform:none; } }
.x2y-fadein { animation: x2y-fadein 0.4s ease forwards; }

/* Copy button feedback */
.copied-flash { background: var(--x2y-accent) !important; color: #fff !important; }
