:root {
    --bg-color: #0a0e1a;
    --glass-bg: rgba(15, 23, 42, 0.85);
    --glass-border: rgba(255, 255, 255, 0.08);
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --primary-glow: rgba(59, 130, 246, 0.3);
    --success: #10b981;
    --success-glow: rgba(16, 185, 129, 0.3);
    --danger: #ef4444;
    --warning: #f59e0b;
    --text-main: #f1f5f9;
    --text-muted: #64748b;
    --card-bg: rgba(15, 23, 42, 0.6);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-color);
    background-image: 
        radial-gradient(ellipse at 10% 0%, rgba(59,130,246,0.12) 0, transparent 60%), 
        radial-gradient(ellipse at 90% 0%, rgba(139,92,246,0.1) 0, transparent 60%),
        radial-gradient(ellipse at 50% 100%, rgba(16,185,129,0.06) 0, transparent 60%);
    background-attachment: fixed;
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.admin-body {
    background-image: 
        radial-gradient(ellipse at 100% 100%, rgba(59,130,246,0.08) 0, transparent 50%), 
        radial-gradient(ellipse at 0% 50%, rgba(139,92,246,0.06) 0, transparent 50%);
}

/* === Glassmorphism === */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border: 1px solid var(--glass-border);
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

/* === Layout === */
.page-wrapper {
    width: 100%;
    max-width: 820px;
    padding: 2rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    min-height: 100vh;
}

.main-header {
    padding: 1.25rem 2rem;
    border-radius: 1rem;
    text-align: center;
}

.main-header h1 {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-weight: 700;
    font-size: 1.5rem;
    background: linear-gradient(135deg, #60a5fa, #a78bfa, #f472b6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.main-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    flex: 1;
}

.content-box {
    padding: 3rem 2rem;
    border-radius: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
}

.text-center { text-align: center; }

/* === Error & Welcome States === */
.error-state, .welcome-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.error-icon, .welcome-icon {
    font-size: 3rem;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

/* === Timer === */
.timer-wrapper {
    position: relative;
    width: 130px;
    height: 130px;
    margin: 0.5rem auto;
    transition: opacity 0.5s ease;
}

.timer-svg {
    transform: rotate(-90deg);
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 0 8px var(--primary-glow));
}

.timer-circle-bg {
    fill: none;
    stroke: rgba(255,255,255,0.06);
    stroke-width: 6;
}

.timer-circle-progress {
    fill: none;
    stroke: url(#timerGradient);
    stroke: var(--primary);
    stroke-width: 6;
    stroke-linecap: round;
    transition: stroke-dashoffset 1s linear;
}

.timer-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2.75rem;
    font-weight: 700;
    color: var(--text-main);
    font-variant-numeric: tabular-nums;
}

.wait-text {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* === Buttons === */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.7rem 1.4rem;
    border: none;
    border-radius: 0.75rem;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    color: white;
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(rgba(255,255,255,0.1), transparent);
    pointer-events: none;
}

.primary-btn {
    background: linear-gradient(135deg, #3b82f6, #6366f1);
    box-shadow: 0 4px 15px var(--primary-glow);
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px var(--primary-glow);
}

.success-btn {
    background: linear-gradient(135deg, #10b981, #059669);
    box-shadow: 0 4px 15px var(--success-glow);
}

.success-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px var(--success-glow);
}

.danger-btn {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.25);
}

.danger-btn:hover {
    background: rgba(239, 68, 68, 0.3);
    color: white;
    border-color: rgba(239, 68, 68, 0.5);
}

.btn-lg { padding: 1rem 2.5rem; font-size: 1.15rem; border-radius: 1rem; }
.btn-sm { padding: 0.4rem 0.8rem; font-size: 0.8rem; }
.btn-icon { padding: 0.5rem; border-radius: 0.5rem; }
.btn-icon svg { pointer-events: none; }
.w-100 { width: 100%; }

/* === Pulse Animation === */
@keyframes pulse {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.6); }
    70% { transform: scale(1.03); box-shadow: 0 0 0 12px rgba(16, 185, 129, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.pulse-anim { animation: pulse 2s infinite; }

/* === Ad Container === */
.ad-container {
    padding: 1.25rem;
    border-radius: 1rem;
    position: relative;
    border: 1px dashed rgba(255,255,255,0.12);
    min-height: 100px;
}

.ad-label {
    position: absolute;
    top: -10px;
    left: 20px;
    background: var(--bg-color);
    padding: 2px 10px;
    font-size: 0.65rem;
    color: var(--text-muted);
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.ad-placeholder {
    min-height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    text-align: center;
    font-size: 0.85rem;
}

/* === Footer === */
.main-footer {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8rem;
    padding: 1rem 0;
    opacity: 0.6;
}

/* ===========================
   ADMIN PANEL STYLES
   =========================== */

.login-container {
    width: 100%;
    max-width: 380px;
    margin: 12vh auto;
    padding: 2.5rem;
    border-radius: 1.5rem;
}

.login-icon {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.login-container h2 {
    margin-bottom: 1.75rem;
    text-align: center;
    font-size: 1.5rem;
}

/* Form */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.4rem;
    font-weight: 500;
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group input, .form-group select {
    width: 100%;
    padding: 0.8rem 1rem;
    border-radius: 0.75rem;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(0,0,0,0.3);
    color: white;
    font-family: inherit;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.form-group input:focus, .form-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.form-group input::placeholder {
    color: rgba(255,255,255,0.2);
}

.form-group select option {
    background: #1e293b;
    color: white;
}

/* Alerts */
.alert {
    padding: 1rem 1.25rem;
    border-radius: 0.75rem;
    margin-bottom: 1.25rem;
    font-size: 0.9rem;
    line-height: 1.6;
}

.alert.error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.25);
    color: #fca5a5;
}

.alert.success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.25);
    color: #6ee7b7;
}

.alert a {
    color: #93c5fd;
    text-decoration: underline;
}

/* Short link copy input */
.short-link-display {
    display: block;
    margin-top: 0.75rem;
}

.short-link-display input {
    width: 100%;
    padding: 0.6rem 0.8rem;
    border-radius: 0.5rem;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(0,0,0,0.3);
    color: #93c5fd;
    font-size: 0.85rem;
    font-family: 'Inter', monospace;
    cursor: pointer;
    transition: border-color 0.3s;
}

.short-link-display small {
    display: block;
    color: var(--text-muted);
    font-size: 0.75rem;
    margin-top: 0.25rem;
}

/* Navbar */
.navbar {
    width: 100%;
    padding: 0.75rem 1.5rem;
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--glass-border);
}

.nav-content {
    max-width: 1300px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-content h1 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.25rem;
    background: linear-gradient(135deg, #60a5fa, #a78bfa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.admin-badge {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    background: rgba(255,255,255,0.05);
    padding: 0.35rem 0.75rem;
    border-radius: 2rem;
}

/* Container */
.container {
    width: 100%;
    max-width: 1300px;
    margin: 1.5rem auto;
    padding: 0 1rem;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.stat-card {
    padding: 1.25rem;
    border-radius: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: transform 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

/* Grid layout */
.grid {
    display: grid;
    grid-template-columns: 340px 1fr;
    gap: 1.5rem;
    align-items: start;
}

@media (max-width: 900px) {
    .grid { grid-template-columns: 1fr; }
}

/* Cards */
.card {
    padding: 1.75rem;
    border-radius: 1.25rem;
}

.card h2 {
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
    color: #cbd5e1;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Table */
.table-responsive { overflow-x: auto; }

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

.table th, .table td {
    padding: 0.85rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    font-size: 0.875rem;
    white-space: nowrap;
}

.table th {
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table tbody tr {
    transition: background 0.2s;
}

.table tbody tr:hover {
    background: rgba(255,255,255,0.03);
}

.truncate {
    max-width: 180px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.short-link {
    color: #60a5fa;
    text-decoration: none;
    font-weight: 500;
    font-family: 'Inter', monospace;
    font-size: 0.85rem;
}

.short-link:hover { text-decoration: underline; }

/* Badges */
.badge {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: 0.4rem;
    font-size: 0.75rem;
    font-weight: 600;
    background: rgba(59, 130, 246, 0.15);
    color: #93c5fd;
}

.badge-green {
    background: rgba(16, 185, 129, 0.15);
    color: #6ee7b7;
}

.badge-yellow {
    background: rgba(245, 158, 11, 0.15);
    color: #fcd34d;
}

/* === Scrollbar === */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.1);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.2);
}

/* === Selection === */
::selection {
    background: rgba(59,130,246,0.3);
    color: white;
}
