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

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --success: #10b981;
    --error: #ef4444;
    --warning: #f59e0b;
    --bg-dark: #0f172a;
    --bg-card: #1e293b;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --border: #334155;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: var(--text-primary);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 900px;
    margin: 0 auto;
}

header {
    text-align: center;
    margin-bottom: 40px;
    animation: fadeInDown 0.6s ease;
}

header h1 {
    font-size: 3rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
}

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

main {
    animation: fadeInUp 0.6s ease;
}

.input-section {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

#urlInput {
    flex: 1;
    padding: 16px 20px;
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.3s;
}

#urlInput:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.btn-primary {
    padding: 16px 32px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

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

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

.btn-primary.loading .btn-text {
    opacity: 0;
}

.btn-primary.loading .loader {
    display: block;
}

.loader {
    display: none;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

@keyframes spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

.status-message {
    padding: 16px;
    border-radius: 12px;
    margin-bottom: 20px;
    animation: slideIn 0.3s ease;
}

.status-message.success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid var(--success);
    color: var(--success);
}

.status-message.error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--error);
    color: var(--error);
}

.hidden {
    display: none !important;
}

.media-info {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 20px;
    border: 1px solid var(--border);
    animation: fadeIn 0.5s ease;
}

.info-header {
    display: flex;
    gap: 20px;
    margin-bottom: 24px;
}

.thumbnail {
    width: 200px;
    height: 112px;
    object-fit: cover;
    border-radius: 12px;
    border: 2px solid var(--border);
}

.info-details {
    flex: 1;
}

.platform-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.platform-badge.youtube {
    background: #ff0000;
    color: white;
}

.platform-badge.instagram {
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
    color: white;
}

.platform-badge.facebook {
    background: #1877f2;
    color: white;
}

.info-details h2 {
    font-size: 1.5rem;
    margin-bottom: 8px;
    line-height: 1.4;
}

.info-details p {
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.options-section {
    margin-top: 24px;
}

.options-section h3 {
    margin-bottom: 16px;
    color: var(--text-primary);
}

.option-group {
    margin-bottom: 24px;
}

.option-group h4 {
    color: var(--text-secondary);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.formats-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}

.option-btn {
    width: 100%;
    padding: 14px 20px;
    background: rgba(99, 102, 241, 0.1);
    border: 2px solid var(--border);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 8px;
}

.option-btn:hover {
    background: rgba(99, 102, 241, 0.2);
    border-color: var(--primary);
    transform: translateX(4px);
}

.option-btn:active {
    transform: translateX(2px);
}

.option-btn.downloading {
    background: rgba(16, 185, 129, 0.1);
    border-color: var(--success);
    pointer-events: none;
}

.download-progress {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 24px;
    border: 1px solid var(--border);
    animation: fadeIn 0.5s ease;
}

.download-progress h3 {
    margin-bottom: 16px;
}

.download-item {
    padding: 12px;
    background: rgba(99, 102, 241, 0.05);
    border-radius: 8px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.download-item .status {
    font-size: 1.2rem;
}

.download-item .details {
    flex: 1;
}

.download-item .name {
    font-weight: 500;
    margin-bottom: 4px;
}

.download-item .message {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

footer {
    text-align: center;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    color: var(--text-secondary);
}

footer .note {
    margin-top: 8px;
    font-size: 0.9rem;
}

footer code {
    background: var(--bg-card);
    padding: 2px 8px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
}

@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);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }

    .input-section {
        flex-direction: column;
    }

    .info-header {
        flex-direction: column;
    }

    .thumbnail {
        width: 100%;
        height: auto;
    }

    .formats-list {
        grid-template-columns: 1fr;
    }
}
