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

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --success: #10b981;
    --error: #ef4444;
    --warning: #f59e0b;
    --bg: #f9fafb;
    --surface: #ffffff;
    --text: #1f2937;
    --text-light: #6b7280;
    --border: #e5e7eb;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: var(--text);
    line-height: 1.6;
}

.container {
    max-width: 700px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
header {
    text-align: center;
    color: white;
    margin-bottom: 40px;
    margin-top: 20px;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.95;
    font-weight: 300;
}

/* Main Content */
main {
    flex: 1;
}

/* Cards */
.card {
    background: var(--surface);
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.3s ease-out;
}

.card h2 {
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: var(--text);
}

.card h3 {
    font-size: 1.1rem;
    margin-bottom: 15px;
    color: var(--text);
}

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

/* Form */
.form-group {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

label {
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text);
    font-size: 0.95rem;
}

input[type="text"],
input[type="number"],
input[type="email"] {
    padding: 12px 14px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    font-family: inherit;
}

input[type="text"]:focus,
input[type="number"]:focus,
input[type="email"]:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

small {
    display: block;
    margin-top: 6px;
    color: var(--text-light);
    font-size: 0.85rem;
}

code {
    background: var(--bg);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: "Monaco", "Courier New", monospace;
    color: var(--primary);
}

/* Advanced Settings */
.advanced-settings {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    cursor: pointer;
    user-select: none;
}

.advanced-settings summary {
    font-weight: 600;
    color: var(--primary);
    cursor: pointer;
}

.advanced-settings summary:hover {
    opacity: 0.8;
}

.settings-content {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

/* Buttons */
button {
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    justify-content: center;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

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

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

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-text {
    display: inline-block;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

.spinner.hidden {
    display: none;
}

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

/* Status Cards */
.status-card,
.error-card,
.success-card {
    display: none;
    border-left: 5px solid var(--border);
}

.status-card.visible,
.error-card.visible,
.success-card.visible {
    display: block;
}

.error-card {
    border-left-color: var(--error);
    background: #fef2f2;
}

.error-card p {
    color: var(--error);
    font-weight: 500;
}

.success-card {
    border-left-color: var(--success);
    background: #f0fdf4;
}

.success-card h3 {
    color: var(--success);
}

.status-content {
    margin: 15px 0;
}

.status-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

.status-item:last-child {
    border-bottom: none;
}

.status-label {
    font-weight: 500;
    color: var(--text-light);
}

.status-value {
    font-weight: 600;
    color: var(--text);
}

.download-btn {
    background: var(--success);
    color: white;
    padding: 10px 20px;
    border-radius: 6px;
    text-decoration: none;
    display: inline-block;
    margin-top: 15px;
    text-align: center;
}

.download-btn:hover {
    background: #059669;
}

/* Footer */
footer {
    text-align: center;
    color: white;
    margin-top: 40px;
    opacity: 0.9;
}

footer a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    transition: border-color 0.2s;
}

footer a:hover {
    border-bottom-color: white;
}

footer small {
    color: inherit;
}

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

.visible {
    display: block !important;
}

/* Responsive */
@media (max-width: 600px) {
    header h1 {
        font-size: 1.8rem;
    }

    .subtitle {
        font-size: 0.95rem;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .card {
        padding: 20px;
    }

    .card h2 {
        font-size: 1.3rem;
    }
}
