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

body {
    font-family: system-ui, -apple-system, sans-serif;
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    background-color: #f5f5f5;
    color: #333;
}

.container {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

h1 {
    margin-bottom: 2rem;
    color: #333;
}

h2 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: #444;
    font-size: 1.5rem;
}

h3 {
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    color: #555;
    font-size: 1.2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #555;
}

input[type="text"],
input[type="number"],
textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.2s;
}

input[type="text"]:focus,
input[type="number"]:focus,
textarea:focus {
    outline: none;
    border-color: #4CAF50;
}

input[type="number"] {
    width: 150px;
}

.help-text {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.875rem;
    color: #666;
}

button {
    background-color: #4CAF50;
    color: white;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.2s;
}

button:hover:not(:disabled) {
    background-color: #45a049;
}

button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

.progress-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px solid #eee;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    padding: 1rem;
    background: #f9f9f9;
    border-radius: 4px;
    text-align: center;
}

.stat-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: #666;
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: #333;
}

.progress-bar-container {
    width: 100%;
    height: 30px;
    background: #f0f0f0;
    border-radius: 4px;
    overflow: hidden;
    margin: 1rem 0;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #4CAF50, #66BB6A);
    transition: width 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.875rem;
}

.recent-urls {
    margin-top: 1rem;
}

.url-item {
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    background: #f9f9f9;
    border-radius: 4px;
    border-left: 3px solid #4CAF50;
}

.url-item .url {
    font-family: monospace;
    font-size: 0.875rem;
    color: #333;
    word-break: break-all;
}

.url-item .status {
    display: inline-block;
    margin-top: 0.25rem;
    padding: 0.25rem 0.5rem;
    border-radius: 3px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-pending { background: #FFF9C4; color: #F57F17; }
.status-downloading { background: #BBDEFB; color: #1976D2; }
.status-downloaded { background: #C8E6C9; color: #388E3C; }
.status-extracted { background: #A5D6A7; color: #2E7D32; }
.status-error { background: #FFCDD2; color: #C62828; }
.status-skipped { background: #E0E0E0; color: #616161; }

.result-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px solid #eee;
}

.json-display {
    background: #2d2d2d;
    color: #f8f8f2;
    padding: 1.5rem;
    border-radius: 4px;
    overflow-x: auto;
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
    line-height: 1.6;
}

.error-message {
    margin-top: 1rem;
    padding: 1rem;
    background: #FFEBEE;
    border-left: 4px solid #F44336;
    border-radius: 4px;
    color: #C62828;
}

.loading-spinner {
    display: inline-block;
    margin-left: 0.5rem;
    width: 16px;
    height: 16px;
    border: 2px solid #ffffff;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

[x-cloak] {
    display: none !important;
}

/* Gallery spacing */
.gallery {
    margin-bottom: 1rem;
}