/* ===== BASE ===== */
:root {
    --bg-main: #020617;
    --card-bg: rgba(15, 23, 42, 0.6);
    --card-border: rgba(51, 65, 85, 0.5);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --accent-1: #6366f1;
    --accent-2: #a855f7;
    --accent-3: #ec4899;
    --glow-opacity: 0.15;
}

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

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    line-height: 1.6;
    min-height: 100vh;
    padding: 40px 0;
    position: relative;
    overflow-x: hidden;
}

/* ===== BACKGROUND EFFECTS ===== */
.background-effects {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

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

.glow-1 {
    top: -10%;
    left: -10%;
    width: 50vw;
    height: 50vw;
    background: radial-gradient(circle, var(--accent-1), var(--accent-2));
}

.glow-2 {
    bottom: -10%;
    right: -10%;
    width: 60vw;
    height: 60vw;
    background: radial-gradient(circle, var(--accent-2), var(--accent-3));
    animation-delay: -10s;
}

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

.container {
    max-width: 900px;
    margin: auto;
    padding: 0 20px;
    position: relative;
    z-index: 1;
}

/* ===== HEADER ===== */
.header {
    text-align: center;
    margin-bottom: 48px;
    animation: fadeInDown 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.logo-icon {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 80px;
    height: 80px;
    border-radius: 24px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(168, 85, 247, 0.2));
    border: 1px solid rgba(168, 85, 247, 0.3);
    margin-bottom: 20px;
    color: #a855f7;
    box-shadow: 0 0 30px rgba(168, 85, 247, 0.2);
}

.header h1 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 12px;
    letter-spacing: -0.02em;
    background: linear-gradient(to right, #fff, #cbd5e1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.header p {
    color: var(--text-muted);
    font-size: 1.15rem;
    max-width: 600px;
    margin: 0 auto;
}

/* ===== CARDS / GLASSMORPHISM ===== */
.glass {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.2);
}

.card {
    padding: 24px;
    margin-bottom: 24px;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    animation-fill-mode: both;
}

.card:nth-child(2) { animation-delay: 0.1s; }
.card:nth-child(3) { animation-delay: 0.2s; }
.card:nth-child(4) { animation-delay: 0.3s; }

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
    border-color: rgba(99, 102, 241, 0.4);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    color: var(--text-main);
}

.card-header svg {
    color: var(--accent-2);
}

.card-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
}

/* ===== USER INFO ===== */
.user-info {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.info-box {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: background 0.3s;
}

.info-box:hover {
    background: rgba(255, 255, 255, 0.06);
}

.info-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: rgba(99, 102, 241, 0.15);
    color: var(--accent-1);
}

.info-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.info-details span {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    font-weight: 600;
}

.info-details strong {
    font-size: 1.05rem;
    color: var(--text-main);
    font-weight: 600;
}

/* ===== FORM ===== */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 220px 180px;
    gap: 20px;
    align-items: end;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-muted);
}

.input-wrapper, .select-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrapper svg {
    position: absolute;
    left: 16px;
    color: var(--text-muted);
}

input, select {
    width: 100%;
    padding: 14px 16px;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    font-size: 1rem;
    color: var(--text-main);
    font-family: inherit;
    transition: all 0.3s ease;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

input {
    padding-left: 44px;
}

select {
    appearance: none;
    padding-right: 44px;
    cursor: pointer;
}

.select-icon {
    position: absolute;
    right: 16px;
    color: var(--text-muted);
    pointer-events: none;
}

input:focus, select:focus {
    outline: none;
    border-color: var(--accent-1);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
}

input::placeholder {
    color: #475569;
}

/* Buttons */
.btn-primary {
    background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
    color: white;
    border: none;
    padding: 14px 24px;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
    height: 52px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.4);
    filter: brightness(1.1);
}

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

.quick {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.btn-sm {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-sm:hover {
    background: rgba(99, 102, 241, 0.1);
    color: var(--text-main);
    border-color: var(--accent-1);
}

/* ===== OUTPUT ===== */
.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--card-border);
}

.result-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.result-title svg {
    color: #10b981;
}

.result-title h3 {
    margin: 0;
    font-size: 1.25rem;
}

.result-meta {
    display: flex;
    align-items: center;
    gap: 16px;
}

.result-meta small {
    color: var(--text-muted);
}

.badge {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.2);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.pre-wrapper {
    background: #020617;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    position: relative;
}

.pre-wrapper::before {
    content: '';
    display: block;
    height: 32px;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px 12px 0 0;
}

.pre-wrapper::after {
    content: '';
    position: absolute;
    top: 12px;
    left: 16px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ef4444;
    box-shadow: 16px 0 0 #eab308, 32px 0 0 #22c55e;
}

pre {
    padding: 20px;
    color: #38bdf8;
    font-size: 0.875rem;
    overflow-x: auto;
    line-height: 1.6;
    font-family: 'Fira Code', monospace;
    white-space: pre-wrap;
    word-wrap: break-word;
}

pre::-webkit-scrollbar {
    height: 8px;
}

pre::-webkit-scrollbar-track {
    background: #0f172a;
    border-radius: 0 0 12px 12px;
}

pre::-webkit-scrollbar-thumb {
    background: #334155;
    border-radius: 4px;
}

/* ===== DOWNLOAD ===== */
.subtitle {
    color: var(--text-muted);
    margin-bottom: 24px;
    font-size: 0.95rem;
}

.download-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.download-link {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.dl-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: rgba(236, 72, 153, 0.1);
    color: var(--accent-3);
    border-radius: 12px;
    transition: all 0.3s ease;
}

.dl-info {
    display: flex;
    flex-direction: column;
}

.dl-size {
    color: var(--text-main);
    font-weight: 600;
    font-size: 1.1rem;
}

.dl-desc {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.download-link:hover {
    transform: translateY(-3px);
    border-color: rgba(236, 72, 153, 0.4);
    box-shadow: 0 8px 25px rgba(236, 72, 153, 0.15);
    background: rgba(255, 255, 255, 0.05);
}

.download-link:hover .dl-icon {
    background: var(--accent-3);
    color: white;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .header h1 {
        font-size: 2.2rem;
    }
    
    .user-info {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .result-meta {
        flex-direction: column;
        align-items: flex-end;
        gap: 8px;
    }
    
    .pre-wrapper::after {
        display: none;
    }
    .pre-wrapper::before {
        display: none;
    }
}

/* ===== ANIMATIONS ===== */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* ===== LOADING ANIMATION ===== */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

.loading-state {
    pointer-events: none;
    opacity: 0.9;
}

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