:root {
    /* Color Palette */
    --bg-color: #0b0f19;
    --text-primary: #ffffff;
    --text-secondary: #94a3b8;
    
    --accent-primary: #3b82f6;
    --accent-hover: #2563eb;
    --accent-glow: rgba(59, 130, 246, 0.4);
    
    --success: #10b981;
    --success-glow: rgba(16, 185, 129, 0.3);
    
    --error: #ef4444;
    
    /* Glassmorphism */
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    
    /* Layout */
    --radius-lg: 24px;
    --radius-md: 12px;
    --radius-sm: 8px;
    
    --transition-fast: 0.2s ease;
    --transition-smooth: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

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

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    position: relative;
}

/* Dynamic Background Elements */
.background-elements {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.blob {
    position: absolute;
    filter: blur(100px);
    border-radius: 50%;
    animation: float 20s infinite alternate cubic-bezier(0.4, 0, 0.2, 1);
}

.blob-1 {
    top: -10%;
    left: -10%;
    width: 50vw;
    height: 50vw;
    background: radial-gradient(circle, rgba(59,130,246,0.3) 0%, rgba(0,0,0,0) 70%);
}

.blob-2 {
    bottom: -20%;
    right: -10%;
    width: 60vw;
    height: 60vw;
    background: radial-gradient(circle, rgba(139,92,246,0.2) 0%, rgba(0,0,0,0) 70%);
    animation-delay: -5s;
}

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

/* Main Container */
.container {
    width: 100%;
    max-width: 600px;
    padding: 2rem;
    z-index: 1;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 3rem;
}

.logo {
    font-size: 3rem;
    font-weight: 700;
    letter-spacing: -1px;
    margin-bottom: 0.5rem;
}

.logo span {
    color: var(--accent-primary);
    text-shadow: 0 0 20px var(--accent-glow);
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* Upload Section */
.upload-section {
    perspective: 1000px;
}

.drop-zone {
    background: var(--glass-bg);
    border: 2px dashed var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 4rem 2rem;
    text-align: center;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.drop-zone:hover {
    border-color: var(--accent-primary);
    background: rgba(59, 130, 246, 0.05);
    box-shadow: 0 0 40px rgba(59, 130, 246, 0.1);
    transform: translateY(-5px);
}

.drop-zone.dragover {
    border-color: var(--success);
    background: rgba(16, 185, 129, 0.05);
    transform: scale(1.02);
}

.upload-icon {
    width: 64px;
    height: 64px;
    color: var(--accent-primary);
    margin-bottom: 1.5rem;
    transition: var(--transition-smooth);
}

.drop-zone:hover .upload-icon {
    transform: translateY(-10px);
    filter: drop-shadow(0 10px 10px rgba(59, 130, 246, 0.4));
}

.upload-content h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.upload-content p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.8rem 1.5rem;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition-fast);
    border: none;
    outline: none;
}

.primary-btn {
    background: var(--accent-primary);
    color: white;
    box-shadow: 0 4px 15px var(--accent-glow);
}

.primary-btn:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--accent-glow);
}

.secondary-btn {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    backdrop-filter: blur(4px);
}

.secondary-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}

.outline-btn {
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    width: 100%;
    margin-top: 1rem;
}

.outline-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.2);
}

/* Loading State */
.loading-state {
    position: absolute;
    inset: 0;
    background: rgba(11, 15, 25, 0.9);
    backdrop-filter: blur(8px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border-radius: var(--radius-lg);
    z-index: 10;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Result Section */
.glass-panel {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: var(--glass-shadow);
    animation: slideUp 0.5s var(--transition-smooth) forwards;
}

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

.result-card h3 {
    text-align: center;
    color: var(--success);
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

.preview-container {
    width: 100%;
    height: 250px;
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: 1.5rem;
    background: rgba(0, 0, 0, 0.2);
    display: flex;
    justify-content: center;
    align-items: center;
}

#preview-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.link-container label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.input-group {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.input-group input {
    flex: 1;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    padding: 0.8rem 1rem;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 1rem;
    outline: none;
    transition: var(--transition-fast);
}

.input-group input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

/* Utility */
.hidden {
    display: none !important;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    padding: 1rem 2rem;
    border-radius: 50px;
    color: white;
    font-weight: 600;
    box-shadow: var(--glass-shadow);
    transition: var(--transition-smooth);
    opacity: 0;
    z-index: 100;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* Mobile Responsive */
@media (max-width: 600px) {
    /* Hide scrollbar for mobile */
    body {
        -ms-overflow-style: none;  /* IE and Edge */
        scrollbar-width: none;  /* Firefox */
    }
    body::-webkit-scrollbar {
        display: none; /* Chrome, Safari and Opera */
    }

    .container {
        padding: 1rem;
    }
    
    .logo {
        font-size: 2.5rem;
    }
    
    .drop-zone {
        padding: 3rem 1rem;
    }
    
    .input-group {
        flex-direction: column;
    }
    
    .secondary-btn {
        width: 100%;
    }
}
