:root {
    --primary: #4F46E5;
    --primary-hover: #4338CA;
    --bg-dark: #0f172a;
    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --success: #10b981;
    --error: #ef4444;
}

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

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

/* Dynamic Background */
.background-elements {
    position: absolute;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
}

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

.blob-1 {
    width: 400px;
    height: 400px;
    background: #4F46E5;
    top: -100px;
    left: -100px;
}

.blob-2 {
    width: 500px;
    height: 500px;
    background: #db2777;
    bottom: -150px;
    right: -100px;
    animation-delay: -5s;
}

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

/* Glass Panel Layout */
.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: 3rem;
    width: 90%;
    max-width: 800px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

header {
    text-align: center;
}

.gradient-text {
    font-size: 3rem;
    font-weight: 600;
    background: linear-gradient(to right, #818cf8, #c084fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}

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

/* Input Section */
.input-wrapper {
    display: flex;
    gap: 1rem;
    position: relative;
}

input[type="url"] {
    flex: 1;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--glass-border);
    padding: 1rem 1.5rem;
    border-radius: 12px;
    color: var(--text-main);
    font-family: inherit;
    font-size: 1rem;
    outline: none;
    transition: all 0.3s ease;
}

input[type="url"]:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.2);
}

.primary-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0 2rem;
    border-radius: 12px;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

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

.primary-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.error-text {
    color: var(--error);
    margin-top: 0.5rem;
    font-size: 0.9rem;
}

.hidden {
    display: none !important;
}

/* Tracker Section */
.tracker-section {
    background: rgba(15, 23, 42, 0.4);
    border-radius: 16px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.state-tracker {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    z-index: 2;
    width: 80px;
}

.step .icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--glass-border);
    border: 2px solid var(--text-muted);
    transition: all 0.5s ease;
}

.step span {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: center;
    transition: all 0.3s ease;
}

/* Connecting Lines */
.line {
    flex: 1;
    height: 2px;
    background: var(--glass-border);
    margin: 0 -30px 25px -30px;
    z-index: 1;
    transition: background 0.5s ease;
}

/* State Classes applied via JS */
.step.active .icon {
    border-color: var(--primary);
    background: var(--primary);
    box-shadow: 0 0 15px var(--primary);
}

.step.active span {
    color: var(--primary);
    font-weight: 600;
}

.step.completed .icon {
    border-color: var(--success);
    background: var(--success);
}

.step.completed span {
    color: var(--success);
}

.line.active {
    background: var(--primary);
}

.line.completed {
    background: var(--success);
}

.log-output {
    font-family: monospace;
    color: var(--text-muted);
    background: rgba(0, 0, 0, 0.2);
    padding: 1rem;
    border-radius: 8px;
    min-height: 50px;
    display: flex;
    align-items: center;
}

/* Download Section */
.download-section {
    display: flex;
    justify-content: center;
    animation: fadeIn 0.5s ease;
}

.download-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    text-decoration: none;
    padding: 1rem 2.5rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    box-shadow: 0 10px 25px -5px rgba(16, 185, 129, 0.4);
}

.download-btn:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 15px 30px -5px rgba(16, 185, 129, 0.6);
}

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