:root {
    --bg-dark: #07070a;
    --accent-primary: #6366f1;
    --accent-secondary: #a855f7;
    --accent-success: #10b981;
    --accent-error: #ef4444;
    --text-primary: #ffffff;
    --text-muted: rgba(255, 255, 255, 0.6);
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-hover: rgba(255, 255, 255, 0.06);
    --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.5);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
}

/* Premium Background Blobs */
.background-gradients {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

.blob {
    position: absolute;
    width: 50vw;
    height: 50vw;
    filter: blur(150px);
    border-radius: 50%;
    opacity: 0.1;
    animation: move 30s infinite alternate cubic-bezier(0.4, 0, 0.2, 1);
}

.blob-1 { background: var(--accent-primary); top: -10%; left: -10%; }
.blob-2 { background: var(--accent-secondary); bottom: -10%; right: -10%; animation-delay: -5s; }
.blob-3 { background: #ec4899; top: 40%; left: 30%; width: 30vw; height: 30vw; }

@keyframes move {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(100px, 100px) scale(1.1); }
}

/* Navigation Bar */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(7, 7, 10, 0.6);
    backdrop-filter: blur(15px);
    border-bottom: 1px solid var(--glass-border);
    z-index: 1000;
}

.navbar .logo { font-size: 1.5rem; font-weight: 800; letter-spacing: -2px; margin-bottom: 0; }
.navbar .logo span { color: var(--accent-primary); font-weight: 300; }

.navbar-actions { display: flex; gap: 1rem; }

/* Layout Containers */
.container {
    width: 95%;
    max-width: 1000px;
    margin: 0 auto;
    padding: 8rem 1rem 4rem;
}

.glassmorphism {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-lg);
    border-radius: 24px;
    transition: transform 0.3s ease;
}

/* Typography */
.header { text-align: center; margin-bottom: 3.5rem; }
.logo { font-size: 4rem; font-weight: 800; letter-spacing: -3px; margin-bottom: 0.75rem; display: block; }
.logo span { background: linear-gradient(to right, var(--accent-primary), var(--accent-secondary)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; font-weight: 300; }
.subtitle { color: var(--text-muted); font-size: 1.25rem; max-width: 600px; margin: 0 auto; }

/* Cards & Inputs */
.card { padding: 2.5rem; margin-bottom: 2rem; }
.url-input-group { display: flex; flex-direction: column; gap: 1rem; }

@media (min-width: 768px) {
    .url-input-group { flex-direction: row; align-items: stretch; }
}

input {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    padding: 1.2rem 1.5rem;
    border-radius: 16px;
    color: #fff;
    font-size: 1rem;
    outline: none;
    transition: all 0.3s ease;
    width: 100%;
}

input:focus { border-color: var(--accent-primary); background: rgba(255, 255, 255, 0.08); box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1); }

.btn {
    padding: 0.8rem 1.5rem;
    border-radius: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    text-decoration: none;
    border: none;
    color: #fff;
}

.btn-primary { background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary)); }
.btn-primary:hover { transform: translateY(-3px); box-shadow: 0 10px 25px rgba(99, 102, 241, 0.4); }

.btn-secondary { background: var(--glass-bg); border: 1px solid var(--glass-border); }
.btn-secondary:hover { background: var(--glass-hover); transform: translateY(-2px); }

.btn-danger { background: rgba(239, 68, 68, 0.1); color: var(--accent-error); border: 1px solid rgba(239, 68, 68, 0.2); }
.btn-danger:hover { background: rgba(239, 68, 68, 0.2); }

/* Result Area */
.result-container { margin-top: 2rem; animation: slideUp 0.4s ease; }
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

.result-card { background: rgba(255, 255, 255, 0.04); border-radius: 18px; padding: 2rem; border: 1px dashed var(--accent-primary); text-align: center; }
.short-url-output { display: flex; flex-direction: column; align-items: center; gap: 1rem; }
@media (min-width: 640px) { .short-url-output { flex-direction: row; justify-content: center; } }

#shortened-url-text { font-size: 1.5rem; font-weight: 800; color: var(--accent-primary); word-break: break-all; }

/* Advanced Toggle */
.advanced-toggle { padding: 1rem 0; color: var(--text-muted); cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 0.5rem; transition: color 0.3s; font-size: 0.9rem; }
.advanced-toggle:hover, .advanced-toggle.active { color: #fff; }

.options-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.5rem; margin-top: 1.5rem; text-align: left; }
.input-subgroup { display: flex; flex-direction: column; gap: 0.5rem; }
.input-subgroup label { font-size: 0.8rem; font-weight: 600; color: var(--text-muted); }

/* Dashboard Tables */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.5rem; margin-bottom: 3rem; }
.stat-card { padding: 2rem; display: flex; flex-direction: column; align-items: flex-start; }
.stat-card h3 { font-size: 0.9rem; color: var(--text-muted); margin-bottom: 0.5rem; }
.stat-card .value { font-size: 2.5rem; font-weight: 800; line-height: 1; margin-bottom: 0.5rem; }

.url-list-card { padding: 0; overflow: hidden; }
.url-list-card h2 { padding: 2rem 2.5rem; border-bottom: 1px solid var(--glass-border); font-size: 1.25rem; }

table { width: 100%; border-collapse: collapse; }
th { background: rgba(255,255,255,0.02); padding: 1.25rem 2.5rem; font-size: 0.75rem; color: var(--text-muted); text-align: left; letter-spacing: 1px; text-transform: uppercase; }
td { padding: 1.5rem 2.5rem; border-bottom: 1px solid var(--glass-border); }

.url-info { display: flex; flex-direction: column; }
.url-info strong { font-size: 1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 300px; }
.url-info small { color: var(--text-muted); font-size: 0.75rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 300px; }

.status-badge { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.4rem 0.8rem; border-radius: 99px; font-size: 0.7rem; font-weight: 800; text-transform: uppercase; }
.status-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; display: block; }
.status-active { background: rgba(16, 185, 129, 0.1); color: #10b981; }
.status-active::before { background: #10b981; }
.status-expired { background: rgba(239, 68, 68, 0.1); color: #ef4444; }
.status-expired::before { background: #ef4444; }

/* QR Section */
.qr-section { margin-top: 2.5rem; padding-top: 2rem; border-top: 1px solid var(--glass-border); }
.qr-container { background: #fff; padding: 1.5rem; border-radius: 24px; display: inline-block; margin: 1.5rem 0; }
.qr-container img { width: 180px; height: 180px; }

/* Mobile Adaptations */
@media (max-width: 768px) {
    .container { padding-top: 7rem; }
    .logo { font-size: 2.75rem; letter-spacing: -2px; }
    .card { padding: 1.5rem; }
    
    table, thead, tbody, th, td, tr { display: block; }
    thead { display: none; }
    tr { margin-bottom: 2rem; border-bottom: 2px solid var(--glass-border); padding-bottom: 1rem; }
    td { border-bottom: none; padding: 0.75rem 1.5rem; display: flex; justify-content: space-between; align-items: center; text-align: right; }
    td::before { content: attr(data-label); font-size: 0.75rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; text-align: left; }
    
    .url-info { align-items: flex-end; }
    .url-info strong, .url-info small { max-width: 200px; }
}

footer { padding: 4rem 1.5rem; text-align: center; color: var(--text-muted); font-size: 0.9rem; border-top: 1px solid var(--glass-border); margin-top: 5rem; }
footer i { color: var(--accent-error); }

.hidden { display: none !important; }
