:root {
    --bg-color: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.7);
    --primary: #3b82f6;
    --accent: #f43f5e;
    --text: #f1f5f9;
    --text-muted: #94a3b8;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-color);
    background-image:
        radial-gradient(at 0% 0%, rgba(59, 130, 246, 0.3) 0px, transparent 50%),
        radial-gradient(at 100% 0%, rgba(244, 63, 94, 0.3) 0px, transparent 50%);
    color: var(--text);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
}

.container {
    text-align: center;
    width: 100%;
    max-width: 500px;
    padding: 2rem;
}

h1 {
    font-size: 3rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.accent {
    color: var(--accent);
    background: -webkit-linear-gradient(45deg, var(--accent), #fb7185);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

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

.card {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 2.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.stats-card {
    margin-top: 1.5rem;
    text-align: left;
}

.stats-header {
    font-weight: 600;
    margin-bottom: 1rem;
}

.stats-totals {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
}

.stat {
    background: rgba(15, 23, 42, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 0.6rem 0.8rem;
    min-width: 110px;
}

.stat .label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.stats-recent-title {
    font-weight: 600;
    margin-bottom: 0.6rem;
}

.recent-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.recent-item {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    padding: 0.6rem 0.7rem;
    background: rgba(15, 23, 42, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
}

.recent-title {
    font-weight: 600;
}

.recent-meta {
    color: var(--text-muted);
    font-size: 0.85rem;
}

input {
    width: 100%;
    padding: 1rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(15, 23, 42, 0.6);
    color: var(--text);
    font-size: 1rem;
    margin-bottom: 1.5rem;
    box-sizing: border-box;
    transition: all 0.3s ease;
}

input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.options {
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: center;
}

.toggle-container {
    background: rgba(15, 23, 42, 0.6);
    padding: 0.3rem;
    border-radius: 12px;
    display: flex;
    gap: 0.5rem;
}

.toggle-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
}

.toggle-count {
    font-size: 0.8rem;
    padding: 0.15rem 0.45rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.10);
    color: var(--text-muted);
}

.toggle-btn.active {
    background: var(--card-bg);
    color: var(--primary);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.toggle-btn.active .toggle-count {
    color: var(--primary);
    border-color: rgba(59, 130, 246, 0.25);
}

#downloadBtn {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, var(--primary), #2563eb);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

#downloadBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -5px rgba(59, 130, 246, 0.5);
}

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

#downloadBtn:disabled {
    background: var(--text-muted);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.progress-wrapper {
    margin-bottom: 1.5rem;
    text-align: left;
}

.progress-bar-bg {
    width: 100%;
    background: rgba(255, 255, 255, 0.1);
    height: 10px;
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #51cf66, #3b82f6);
    width: 0%;
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 0.85rem;
    color: var(--text-muted);
}

#statusMessage {
    margin-top: 1.5rem;
    min-height: 1.5rem;
    font-size: 0.95rem;
    word-break: break-all;
}

#statusMessage a {
    color: #51cf66;
    text-decoration: underline;
}

.success-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 0.75rem;
}

.success-text {
    font-weight: 600;
}

.action-btn {
    appearance: none;
    border: none;
    border-radius: 12px;
    padding: 0.6rem 0.9rem;
    font-weight: 600;
    cursor: pointer;
    color: white;
    background: linear-gradient(135deg, var(--primary), #2563eb);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.action-btn.secondary {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--text);
}