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

:root {
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --background: #ffffff;
    --foreground: #0f172a;
    --muted: #64748b;
    --border: #e2e8f0;
    --card: #ffffff;
    --destructive: #ef4444;
    --destructive-foreground: #fef2f2;
}

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

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: var(--background);
    border-radius: 20px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    overflow: hidden;
}

header {
    text-align: center;
    padding: 60px 20px 40px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 16px;
}

header .highlight {
    color: #fbbf24;
}

.subtitle {
    font-size: 1.125rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

.input-section {
    padding: 40px 20px;
    background: var(--background);
}

.input-wrapper {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    gap: 12px;
}

#urlInput {
    flex: 1;
    padding: 16px 20px;
    font-size: 1rem;
    border: 2px solid var(--border);
    border-radius: 12px;
    outline: none;
    transition: border-color 0.3s;
}

#urlInput:focus {
    border-color: var(--primary);
}

.btn-primary {
    padding: 16px 32px;
    font-size: 1rem;
    font-weight: 600;
    color: white;
    background: var(--primary);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.3s, transform 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 120px;
    justify-content: center;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
}

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

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

.loader {
    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;
    display: none;
}

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

.error-section {
    padding: 20px;
    margin: 0 20px;
    background: var(--destructive);
    color: var(--destructive-foreground);
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideIn 0.3s ease-out;
}

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

.error-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.loading-section {
    padding: 60px 20px;
    text-align: center;
    color: var(--muted);
}

.spinner {
    width: 60px;
    height: 60px;
    margin: 0 auto 20px;
    border: 4px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.result-section {
    padding: 20px;
    animation: fadeIn 0.5s ease-out;
}

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

.video-player {
    position: relative;
    background: black;
    border-radius: 16px;
    overflow: hidden;
    aspect-ratio: 16/9;
    margin-bottom: 20px;
}

#videoPlayer {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.platform-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 6px 12px;
    background: var(--primary);
    color: white;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 8px;
}

.video-info {
    padding: 20px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    margin-bottom: 20px;
}

.video-info h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 12px;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.meta-info {
    display: flex;
    gap: 20px;
    color: var(--muted);
    font-size: 0.875rem;
}

.meta-info span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.meta-info svg {
    width: 14px;
    height: 14px;
}

.download-section {
    padding: 20px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
}

.download-section h4 {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
    margin-bottom: 12px;
}

.download-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.download-option {
    display: flex;
    align-items: center;
    gap: 0;
}

.btn-play {
    padding: 8px 16px;
    font-size: 0.875rem;
    font-weight: 500;
    color: white;
    background: var(--primary);
    border: none;
    border-radius: 8px 0 0 8px;
    cursor: pointer;
    transition: background 0.3s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-play:hover {
    background: var(--primary-hover);
}

.btn-play svg {
    width: 12px;
    height: 12px;
}

.btn-download {
    padding: 8px 12px;
    font-size: 0.875rem;
    color: var(--foreground);
    background: var(--border);
    border: none;
    border-radius: 0 8px 8px 0;
    cursor: pointer;
    transition: background 0.3s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-download:hover {
    background: var(--muted);
    color: white;
}

.btn-download svg {
    width: 14px;
    height: 14px;
}

.features-section {
    padding: 60px 20px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}

.feature-card {
    padding: 32px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    text-align: center;
    transition: transform 0.3s, box-shadow 0.3s;
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px -8px rgba(0, 0, 0, 0.1);
}

.feature-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 16px;
    padding: 12px;
    background: var(--primary);
    border-radius: 12px;
    color: white;
}

.feature-icon svg {
    width: 24px;
    height: 24px;
}

.feature-card h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.feature-card p {
    font-size: 0.875rem;
    color: var(--muted);
    line-height: 1.6;
}

.platforms-section {
    padding: 60px 20px;
    text-align: center;
}

.platforms-section h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 32px;
}

.platforms-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
    max-width: 800px;
    margin: 0 auto;
}

.platform-item {
    padding: 16px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    font-weight: 500;
    transition: all 0.3s;
}

.platform-item:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-2px);
}

footer {
    padding: 40px 20px;
    text-align: center;
    color: var(--muted);
    font-size: 0.875rem;
    border-top: 1px solid var(--border);
}

.hidden {
    display: none !important;
}

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

    .subtitle {
        font-size: 1rem;
    }

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

    .btn-primary {
        width: 100%;
    }

    .features-section {
        grid-template-columns: 1fr;
    }

    .platforms-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}