:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --secondary: rgba(255, 255, 255, 0.2);
    --secondary-hover: rgba(255, 255, 255, 0.3);
    --text-main: #ffffff;
    --text-muted: #e2e8f0;
    --bg-gradient-1: #0f172a;
    --bg-gradient-2: #1e1b4b;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --success: #10b981;
    --danger: #ef4444;
}

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

body {
    font-family: 'Outfit', sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--bg-gradient-1), var(--bg-gradient-2));
    color: var(--text-main);
    overflow: hidden;
    position: relative;
}

/* Background animated blobs */
.background-elements {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 0;
}

.blob {
    position: absolute;
    filter: blur(80px);
    border-radius: 50%;
    opacity: 0.6;
    animation: float 20s infinite alternate ease-in-out;
}

.blob-1 {
    top: -10%;
    left: -10%;
    width: 400px;
    height: 400px;
    background: #6366f1;
    animation-delay: 0s;
}

.blob-2 {
    bottom: -20%;
    right: -10%;
    width: 500px;
    height: 500px;
    background: #c026d3;
    animation-delay: -5s;
}

.blob-3 {
    top: 40%;
    left: 40%;
    width: 300px;
    height: 300px;
    background: #0ea5e9;
    animation-delay: -10s;
}

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

/* Glassmorphism Panel */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 40px;
    width: 90%;
    max-width: 650px;
    z-index: 1;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transition: transform 0.3s ease;
}

.header {
    text-align: center;
    margin-bottom: 30px;
}

h1 {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 8px;
    background: linear-gradient(to right, #a855f7, #3b82f6);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    font-size: 1rem;
    color: var(--text-muted);
    font-weight: 300;
}

form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.input-group {
    position: relative;
    width: 100%;
}

.input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.5);
    font-size: 1.1rem;
}

input {
    width: 100%;
    padding: 16px 16px 16px 48px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    color: white;
    font-size: 1rem;
    font-family: inherit;
    outline: none;
    transition: all 0.3s ease;
}

input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
    background: rgba(0, 0, 0, 0.3);
}

input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

button {
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    outline: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background: var(--primary);
    color: white;
    padding: 16px;
    border-radius: 12px;
    font-size: 1.1rem;
    box-shadow: 0 4px 14px 0 rgba(99, 102, 241, 0.39);
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.23);
}

.btn-primary:active {
    transform: translateY(0);
}

.hidden {
    display: none !important;
}

#result {
    margin-top: 25px;
    animation: fadeIn 0.5s ease-out forwards;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.result-box {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    border: 1px solid var(--glass-border);
    margin-bottom: 15px;
}

.result-label {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.short-link-text {
    display: block;
    font-size: 1.4rem;
    font-weight: 700;
    color: #38bdf8;
    text-decoration: none;
    word-break: break-all;
    margin-bottom: 12px;
    transition: color 0.2s ease;
}

.short-link-text:hover {
    color: #7dd3fc;
    text-decoration: underline;
}

.visitor-count {
    display: inline-block;
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.action-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 15px;
}

.btn-secondary {
    background: var(--secondary);
    color: white;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    font-size: 1.1rem;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.btn-secondary:hover {
    background: var(--secondary-hover);
    transform: translateY(-2px);
}

#edit-section {
    margin-top: 15px;
    animation: fadeIn 0.3s ease-out forwards;
}

.qr-container {
    display: flex;
    justify-content: center;
    margin-top: 15px;
}

canvas {
    border-radius: 12px;
    padding: 10px;
    background: white;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    animation: scaleIn 0.3s ease-out forwards;
}

@keyframes scaleIn {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* Toastify customization */
.toastify {
    border-radius: 10px !important;
    font-family: 'Outfit', sans-serif !important;
    font-weight: 500 !important;
    padding: 12px 20px !important;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2) !important;
}

@media (max-width: 480px) {
    .glass-panel {
        padding: 30px 20px;
        margin: 20px;
        width: auto;
    }
    
    h1 {
        font-size: 1.8rem;
    }
}

/* Site Stats */
.site-stats {
    position: fixed;
    bottom: 20px;
    left: 0;
    width: 100%;
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
    z-index: 10;
    pointer-events: none;
}

.site-stats i {
    margin-right: 5px;
    color: #a855f7;
}
