:root {
    --bg-base: #f0f9ff;              
    --bg-card: rgba(255, 255, 255, 0.7); 
    --glass-border: rgba(255, 255, 255, 0.8);
    
    --primary: #0ea5e9; 
    --primary-hover: #0284c7;      
    --accent: #14b8a6;            
    
    --text-main: #0f172a;          
    --text-muted: #64748b;           
    
    --border: #e2e8f0; 
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    
    --radius: 16px;
    --container-width: 800px;
    --soft-shadow: 0 20px 40px -10px rgba(14, 165, 233, 0.15);
}

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

body {
    font-family: 'Inter', sans-serif;
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    
    background: linear-gradient(135deg, #e0f2fe 0%, #ccfbf1 100%);
    background-attachment: fixed;
}

.navbar {
    padding: 1.2rem 2rem;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.nav-item {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: color 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-item:hover { color: var(--primary); }

.session-badge {
    background: #dcfce7; 
    color: #16a34a;    
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    border: 1px solid #bbf7d0;
}

.dot {
    width: 8px;
    height: 8px;
    background: #16a34a;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 0 2px rgba(22, 163, 74, 0.2);
}


.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    gap: 2.5rem;
    width: 100%;
    max-width: var(--container-width);
    margin: 0 auto;
}

.hero-text { text-align: center; }
.hero-text h1 { font-size: 3.5rem; font-weight: 800; margin-bottom: 0.5rem; letter-spacing: -1px; }
.gradient-text { background: linear-gradient(135deg, var(--primary), var(--accent)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.hero-text p { color: var(--text-muted); font-size: 1.2rem; }

.glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 3rem;
    width: 100%;
    box-shadow: var(--soft-shadow);
    transition: transform 0.3s ease;
}

.glass-card:hover { transform: translateY(-5px); }


.input-wrapper { position: relative; display: flex; gap: 12px; margin-top: 1.5rem; }
.input-icon { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); color: var(--primary); z-index: 10; font-size: 1.1rem; }

#urlInput {
    flex: 1;
    background: white;
    border: 2px solid var(--border);
    color: var(--text-main);
    padding: 16px 16px 16px 50px;
    border-radius: var(--radius);
    font-size: 1.1rem;
    transition: all 0.2s;
    box-shadow: 0 2px 10px rgba(0,0,0,0.03);
}
#urlInput:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.15); }
#urlInput::placeholder { color: #94a3b8; }

.btn { padding: 16px 28px; border-radius: var(--radius); border: none; font-weight: 600; cursor: pointer; transition: all 0.2s; display: flex; align-items: center; gap: 8px; font-size: 1rem; }
.btn-primary { background: linear-gradient(135deg, var(--primary), var(--accent)); color: white; box-shadow: 0 10px 20px -5px rgba(14, 165, 233, 0.4); }
.btn-primary:hover { opacity: 0.9; transform: translateY(-2px); box-shadow: 0 15px 25px -5px rgba(14, 165, 233, 0.5); }

.btn-text { background: transparent; color: var(--text-muted); font-size: 0.9rem; padding: 10px; }
.btn-text:hover { color: var(--primary); background: #f1f5f9; border-radius: 8px; }

.actions-row { margin-top: 1.5rem; display: flex; justify-content: flex-end; }


.token-reveal-panel {
    background: #fffbeb;
    border: 1px solid #fcd34d;
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 2rem;
    animation: fadeIn 0.4s ease;
}

.reveal-header { color: #d97706; font-weight: 700; margin-bottom: 0.5rem; display: flex; align-items: center; gap: 8px; }
.reveal-warning { font-size: 0.95rem; color: #78350f; margin-bottom: 1rem; }
.token-display-row { display: flex; gap: 10px; align-items: center; }

.token-code {
    flex: 1;
    background: white;
    padding: 14px;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    color: #d97706;
    font-weight: 600;
    border: 2px dashed #fcd34d;
    word-break: break-all;
}

.btn-icon {
    padding: 14px;
    border-radius: 8px;
    background: white;
    border: 1px solid var(--border);
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
}
.btn-icon:hover { color: var(--primary); border-color: var(--primary); }


.result-panel { margin-top: 2rem; padding-top: 2rem; border-top: 1px solid var(--border); display: none; }
.result-panel.show { display: block; animation: fadeIn 0.4s ease; }
.result-success { color: var(--success); font-weight: 700; margin-bottom: 12px; display: flex; align-items: center; gap: 6px; }
.result-input-group { display: flex; background: #f8fafc; padding: 8px; border-radius: var(--radius); border: 1px solid var(--border); }
#shortUrl { flex: 1; background: transparent; border: none; color: var(--text-main); padding: 0 12px; font-weight: 500; }
#shortUrl:focus { outline: none; }
.btn-copy { background: white; color: var(--text-main); padding: 10px 20px; border: 1px solid var(--border); box-shadow: 0 2px 5px rgba(0,0,0,0.05); }
.btn-copy:hover { border-color: var(--primary); color: var(--primary); }
.btn-copy.copied, .btn-icon.copied { background: var(--success); color: white; border-color: var(--success); }


.stats-grid { width: 100%; margin-top: 1rem; }
.full-width { width: 100%; }
.stat-card { background: rgba(255, 255, 255, 0.6); backdrop-filter: blur(10px); border: 1px solid var(--glass-border); padding: 1.5rem; border-radius: var(--radius); display: flex; align-items: center; gap: 1.5rem; box-shadow: var(--soft-shadow); }
.stat-icon { width: 50px; height: 50px; background: #e0f2fe; color: var(--primary); border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.25rem; }
.stat-info { display: flex; flex-direction: column; }
.stat-label { font-size: 0.8rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; font-weight: 600; }
.stat-label-inline { font-size: 0.9rem; color: var(--text-muted); font-weight: 400; margin-left: 8px; }
.stat-numbers { font-size: 1.5rem; font-weight: 800; color: var(--text-main); display: flex; align-items: baseline; }
.stat-separator { color: var(--border); margin: 0 5px; font-weight: 300; font-size: 1.5rem; }
.stat-total { color: var(--text-muted); font-size: 1.2rem; font-weight: 500; }


.footer { padding: 2rem; border-top: 1px solid rgba(255,255,255,0.2); margin-top: auto; text-align: center; color: var(--text-muted); font-size: 0.9rem; background: rgba(255,255,255,0.4); backdrop-filter: blur(5px); }


.alert { padding: 1rem; border-radius: var(--radius); margin-bottom: 1.5rem; display: none; }
.alert.show { display: block; animation: fadeIn 0.4s ease; }
.alert-error { background: #fef2f2; color: #dc2626; border: 1px solid #fca5a5; }
.alert-warning { background: #fffbeb; color: #d97706; border: 1px solid #fcd34d; }
.alert-success { background: #f0fdf4; color: #16a34a; border: 1px solid #86efac; }

.loading { display: inline-block; width: 14px; height: 14px; border: 2px solid rgba(255,255,255,0.3); border-top-color: white; border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadeIn { from { opacity: 0; transform: translateY(-5px); } to { opacity: 1; transform: translateY(0); } }


@media (max-width: 640px) {
    
    .navbar { 
        padding: 0.8rem 1rem; 
    }
    
    .nav-container { 
        padding: 0; 
    }

    
    .nav-item { 
        font-size: 0; 
    }
    .nav-item i { 
        font-size: 1.4rem;
        color: var(--text-main);
    }

    .session-badge {
        font-size: 0; 
        padding: 0;
        border: none;
        background: transparent;
    }
    .session-badge .dot {
        width: 10px;
        height: 10px;
        box-shadow: 0 0 0 2px rgba(22, 163, 74, 0.4);
    }

    
    .logo { 
        font-size: 1.3rem; 
    }

    
    .glass-card { 
        padding: 1.5rem; 
    }
    
    .hero-text h1 { 
        font-size: 2rem; 
    }
    
    .input-wrapper { 
        flex-direction: column; 
    }
    
    .input-icon { 
        top: 24px; 
    }
    
    .btn { 
        width: 100%; 
        justify-content: center; 
    }
    
    .stats-grid { 
        grid-template-columns: 1fr; 
    }
}