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

:root {
    --primary-blue: #0A84FF;
    --secondary-blue: #0066CC;
    --dark-bg: #000000;
    --card-bg: rgba(20, 20, 25, 0.7);
    --glass-bg: rgba(30, 30, 35, 0.6);
    --border-color: rgba(255, 255, 255, 0.1);
    --text-primary: #FFFFFF;
    --text-secondary: rgba(255, 255, 255, 0.6);
    --shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --glow: 0 0 20px rgba(10, 132, 255, 0.3);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #000000 0%, #0a0a0f 50%, #000000 100%);
    min-height: 100vh;
    color: var(--text-primary);
    position: relative;
    overflow-x: hidden;
}

.blur-overlay {
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: 
        radial-gradient(circle at 20% 30%, rgba(10, 132, 255, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(0, 102, 204, 0.1) 0%, transparent 50%);
    animation: float 20s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(30px, -50px) rotate(120deg); }
    66% { transform: translate(-20px, 20px) rotate(240deg); }
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 20px;
    position: relative;
    z-index: 1;
}

.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    box-shadow: var(--shadow);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.main-card {
    padding: 40px;
}

.glass-card:hover {
    border-color: rgba(10, 132, 255, 0.3);
    box-shadow: var(--shadow), var(--glow);
}

.header {
    text-align: center;
    margin-bottom: 40px;
}

.logo-container {
    display: inline-flex;
    padding: 16px;
    background: linear-gradient(135deg, var(--primary-blue), var(--secondary-blue));
    border-radius: 20px;
    margin-bottom: 20px;
    box-shadow: 0 8px 24px rgba(10, 132, 255, 0.4);
}

.logo-icon {
    width: 32px;
    height: 32px;
    color: white;
}

h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #FFFFFF 0%, var(--primary-blue) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

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

.input-container {
    margin-bottom: 30px;
}

.input-wrapper {
    display: flex;
    gap: 12px;
    align-items: stretch;
}

.url-input {
    flex: 1;
    padding: 16px 24px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    color: var(--text-primary);
    font-size: 1rem;
    outline: none;
    transition: all 0.3s ease;
}

.url-input::placeholder {
    color: var(--text-secondary);
}

.url-input:focus {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 4px rgba(10, 132, 255, 0.1);
}

.btn-primary {
    padding: 16px 32px;
    background: linear-gradient(135deg, var(--primary-blue), var(--secondary-blue));
    border: none;
    border-radius: 16px;
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px rgba(10, 132, 255, 0.3);
    white-space: nowrap;
}

.btn-primary svg {
    width: 20px;
    height: 20px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(10, 132, 255, 0.5);
}

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

.btn-full {
    width: 100%;
    justify-content: center;
    margin-top: 24px;
}

.loading-indicator {
    text-align: center;
    padding: 40px;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(10, 132, 255, 0.1);
    border-top-color: var(--primary-blue);
    border-radius: 50%;
    margin: 0 auto 16px;
    animation: spin 1s linear infinite;
}

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

.loading-indicator p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.video-container {
    margin-top: 32px;
}

.video-card {
    padding: 24px;
    margin-bottom: 16px;
    overflow: hidden;
}

.video-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 12px;
    margin-bottom: 16px;
}

.video-info {
    text-align: center;
}

.video-info h3 {
    font-size: 1.25rem;
    margin-bottom: 16px;
    color: var(--text-primary);
    font-weight: 600;
}

.btn-download {
    width: 100%;
    padding: 14px 24px;
    background: linear-gradient(135deg, var(--primary-blue), var(--secondary-blue));
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px rgba(10, 132, 255, 0.3);
}

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

.btn-download:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(10, 132, 255, 0.5);
}

.playlist-container {
    margin-top: 32px;
}

.playlist-title {
    font-size: 1.5rem;
    margin-bottom: 24px;
    text-align: center;
    font-weight: 600;
}

.video-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.playlist-video-card {
    background: linear-gradient(145deg, rgba(30, 30, 35, 0.8), rgba(20, 20, 25, 0.9));
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.playlist-video-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(10, 132, 255, 0.1), transparent);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.playlist-video-card:hover {
    transform: translateY(-8px) scale(1.02);
    border-color: rgba(10, 132, 255, 0.5);
    box-shadow: 0 12px 32px rgba(10, 132, 255, 0.3), 0 0 20px rgba(10, 132, 255, 0.2);
}

.playlist-video-card:hover::before {
    opacity: 1;
}

.playlist-video-card.removed {
    opacity: 0.3;
    filter: grayscale(1);
    transform: scale(0.95);
}

.playlist-video-card.removed:hover {
    transform: scale(0.95);
}

.playlist-video-card img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.playlist-video-card:hover img {
    transform: scale(1.05);
}

.playlist-video-info {
    padding: 16px;
    background: linear-gradient(to bottom, transparent, rgba(0, 0, 0, 0.3));
}

.playlist-video-info h4 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.remove-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0.8;
    z-index: 10;
}

.playlist-video-card:hover .remove-btn {
    opacity: 1;
}

.remove-btn:hover {
    background: linear-gradient(135deg, #ff3b30, #ff1744);
    transform: scale(1.15) rotate(90deg);
    border-color: rgba(255, 59, 48, 0.5);
    box-shadow: 0 4px 12px rgba(255, 59, 48, 0.4);
}

.download-status {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.status-content {
    padding: 40px 60px;
    text-align: center;
    max-width: 400px;
}

.status-content .spinner {
    width: 64px;
    height: 64px;
    border-width: 5px;
}

.status-content p {
    font-size: 1.1rem;
    color: var(--text-primary);
    margin-top: 20px;
}

.hidden {
    display: none !important;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 20px 16px;
    }
    
    .main-card {
        padding: 24px;
        border-radius: 20px;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    .input-wrapper {
        flex-direction: column;
    }
    
    .btn-primary {
        width: 100%;
        justify-content: center;
    }
    
    .video-cards {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 1.75rem;
    }
    
    .main-card {
        padding: 20px;
    }
}
