:root {
    --primary-red: #ff0050;
    --primary-red-hover: #e60048;
    --success-green: #5cb85c;
    --success-green-hover: #4cae4c;
    --bg-gradient: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    --card-bg: rgba(255, 255, 255, 0.95);
    --text-dark: #1e3c72;
    --text-muted: #666;
    --border-color: #ddd;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-gradient);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    overflow-x: hidden;
}

.bg-blobs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.blob {
    position: absolute;
    width: 400px;
    height: 400px;
    background: #667eea;
    filter: blur(80px);
    border-radius: 50%;
    opacity: 0.2;
    top: -100px;
    left: -100px;
    animation: float 20s infinite alternate;
}

.blob-2 {
    background: #f5576c;
    top: auto;
    bottom: -100px;
    right: -100px;
    animation-delay: -5s;
}

@keyframes float {
    from { transform: translate(0, 0) scale(1); }
    to { transform: translate(100px, 100px) scale(1.1); }
}

.downloader-card {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 40px;
    width: 100%;
    max-width: 800px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
}

header {
    text-align: center;
    margin-bottom: 30px;
}

header h1 {
    color: var(--text-dark);
    font-size: 2rem;
    margin-bottom: 10px;
}

header p {
    color: var(--text-muted);
}

.search-section {
    margin-bottom: 30px;
}

.url-input-group {
    display: flex;
    gap: 0;
    margin-bottom: 15px;
    border: 3px solid var(--primary-red);
    border-radius: 12px;
    overflow: hidden;
}

.url-input-group input {
    flex: 1;
    padding: 15px 20px;
    border: none;
    outline: none;
    font-size: 1rem;
}

.url-input-group button {
    background: var(--primary-red);
    color: white;
    border: none;
    padding: 0 30px;
    font-weight: 700;
    font-size: 1.1rem;
    cursor: pointer;
    transition: background 0.3s;
}

.url-input-group button:hover {
    background: var(--primary-red-hover);
}

.terms-text {
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.terms-text a {
    color: #f5576c;
    text-decoration: none;
}

.result-section {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 30px;
    margin-top: 40px;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.video-info {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.thumbnail-container {
    width: 100%;
    aspect-ratio: 16/9;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
}

.thumbnail-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video-info h2 {
    font-size: 1.1rem;
    color: var(--text-dark);
    line-height: 1.4;
}

/* Tabs */
.download-options {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.tabs {
    display: flex;
    background: #f5f5f5;
    border-bottom: 1px solid var(--border-color);
}

.tab-btn {
    flex: 1;
    padding: 12px;
    border: none;
    background: none;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.tab-btn.active {
    background: white;
    color: var(--primary-red);
}

.tab-btn:not(:last-child) {
    border-right: 1px solid var(--border-color);
}

/* Table */
.table-container {
    width: 100%;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

th {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
}

td {
    font-weight: 500;
    color: #333;
}

td:nth-child(2) {
    color: #666;
}

.download-btn {
    background: var(--success-green);
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.3s;
    text-decoration: none;
    font-size: 0.9rem;
}

.download-btn:hover {
    background: var(--success-green-hover);
}

/* Loading Spinner */
.loading-spinner {
    text-align: center;
    margin-top: 30px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-top-color: var(--primary-red);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 10px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 768px) {
    .downloader-card {
        padding: 20px;
    }
    
    .result-section {
        grid-template-columns: 1fr;
    }
    
    .url-input-group {
        flex-direction: column;
        border: none;
        gap: 10px;
    }
    
    .url-input-group input {
        border: 3px solid var(--primary-red);
        border-radius: 12px;
    }
    
    .url-input-group button {
        padding: 15px;
        border-radius: 12px;
    }
}
