:root {
    --primary: oklch(0.65 0.25 260);
    --primary-glow: oklch(0.65 0.25 260 / 0.3);
    --accent: oklch(0.7 0.2 320);
    --bg-dark: oklch(0.15 0.02 250);
    --text-light: oklch(0.95 0.01 250);
    --text-dim: oklch(0.7 0.02 250);
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --error: oklch(0.6 0.2 20);
}

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

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-light);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    position: relative;
}

/* Background Animations */
.background-blobs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    filter: blur(80px);
}

.blob {
    position: absolute;
    border-radius: 50%;
    opacity: 0.5;
    animation: move 20s infinite alternate;
}

.blob-1 {
    width: 400px;
    height: 400px;
    background: var(--primary);
    top: -100px;
    left: -100px;
}

.blob-2 {
    width: 500px;
    height: 500px;
    background: var(--accent);
    bottom: -150px;
    right: -100px;
    animation-delay: -5s;
}

.blob-3 {
    width: 300px;
    height: 300px;
    background: oklch(0.6 0.15 150);
    top: 40%;
    left: 30%;
    animation-duration: 25s;
}

@keyframes move {
    from { transform: translate(0, 0) rotate(0deg); }
    to { transform: translate(100px, 100px) rotate(360deg); }
}

/* App Container */
.app-container {
    flex: 1;
    max-width: 900px;
    width: 95%;
    margin: 4rem auto;
    padding: 2rem;
    z-index: 1;
}

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

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.logo-icon {
    width: 40px;
    height: 40px;
    color: var(--primary);
    filter: drop-shadow(0 0 10px var(--primary-glow));
}

h1 {
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

h1 span {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

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

/* Capture Box */
.capture-box {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    padding: 1.5rem;
    border-radius: 24px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    margin-bottom: 2rem;
}

.input-group {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.input-icon {
    color: var(--text-dim);
    margin-left: 0.5rem;
}

#urlInput {
    flex: 1;
    background: transparent;
    border: none;
    color: white;
    font-size: 1.1rem;
    padding: 0.5rem;
    outline: none;
}

#urlInput::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

#captureBtn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px var(--primary-glow);
}

#captureBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px var(--primary-glow);
    filter: brightness(1.1);
}

#captureBtn:active {
    transform: translateY(0);
}

.error-message {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--error);
    margin-top: 1rem;
    font-size: 0.9rem;
    animation: fadeIn 0.3s ease;
}

/* Result Section */
.result-section {
    animation: slideUp 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.result-card {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    overflow: hidden;
}

.result-header {
    padding: 1rem 1.5rem;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#resultUrl {
    color: var(--text-dim);
    font-size: 0.9rem;
    font-family: monospace;
}

.download-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.download-btn:hover {
    background: var(--primary);
    transform: scale(1.1);
}

.preview-container {
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.2);
    position: relative;
}

#screenshotPreview {
    width: 100%;
    height: auto;
    display: block;
    animation: fadeIn 1s ease;
}

/* Loader */
.loader {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

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

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

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { 
    from { opacity: 0; transform: translateY(20px); } 
    to { opacity: 1; transform: translateY(0); } 
}

/* Footer */
.app-footer {
    text-align: center;
    padding: 2rem;
    color: var(--text-dim);
    font-size: 0.9rem;
}

/* Mobile Responsive */
@media (max-width: 600px) {
    .input-group {
        flex-direction: column;
        align-items: stretch;
    }
    
    #captureBtn {
        justify-content: center;
    }
    
    h1 { font-size: 1.8rem; }
}
