:root {
    --primary: #DD2476;
    --secondary: #FF512F;
    --bg-dark: #0f0c29;
    --bg-mid: #302b63;
    --bg-light: #24243e;
    --text-main: #ffffff;
    --text-muted: #a0a0b8;
    --card-bg: rgba(255, 255, 255, 0.05);
    --card-border: rgba(255, 255, 255, 0.1);
}

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

body {
    font-family: 'Outfit', sans-serif;
    color: var(--text-main);
    background: var(--bg-dark);
    min-height: 100vh;
    overflow-x: hidden;
}

.bg-gradient {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(135deg, var(--bg-dark), var(--bg-mid), var(--bg-light));
    z-index: -1;
}

.bg-gradient::before, .bg-gradient::after {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    filter: blur(150px);
    opacity: 0.35;
    z-index: -1;
    animation: drift 15s ease-in-out infinite alternate;
}

.bg-gradient::before {
    top: 10%;
    left: 10%;
    background: var(--primary);
}

.bg-gradient::after {
    bottom: 10%;
    right: 10%;
    background: var(--secondary);
    animation-delay: -5s;
}

@keyframes drift {
    from { transform: translate(0, 0); }
    to { transform: translate(30px, -30px); }
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem;
}

header {
    display: flex;
    justify-content: center;
    padding-bottom: 4rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: 1px;
}

.main-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.hero-title {
    font-size: 4rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.hero-title span {
    background: linear-gradient(135deg, var(--secondary), var(--primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    font-size: 1.3rem;
    color: var(--text-muted);
    margin-bottom: 3rem;
    max-width: 600px;
}

.search-box {
    display: flex;
    width: 100%;
    max-width: 700px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 50px;
    padding: 0.5rem;
    backdrop-filter: blur(12px);
    transition: all 0.3s ease;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}

.search-box:focus-within {
    border-color: rgba(255,255,255,0.3);
    box-shadow: 0 8px 32px rgba(221, 36, 118, 0.3);
}

#url-input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-main);
    font-size: 1.1rem;
    padding: 0 1.5rem;
    outline: none;
    font-family: inherit;
}

#url-input::placeholder {
    color: rgba(255,255,255,0.4);
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    outline: none;
}

#submit-btn {
    background: linear-gradient(135deg, var(--secondary), var(--primary));
    color: white;
    padding: 1rem 2rem;
    border-radius: 40px;
    font-size: 1.1rem;
    font-weight: 600;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 150px;
}

#submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(221, 36, 118, 0.5);
}

.loader-spinner {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

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

.result-card {
    margin-top: 3rem;
    width: 100%;
    max-width: 700px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 24px;
    padding: 2rem;
    backdrop-filter: blur(12px);
    animation: slideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    text-align: left;
    box-shadow: 0 15px 35px rgba(0,0,0,0.2);
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(40px); }
    to { opacity: 1; transform: translateY(0); }
}

.video-info {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

#video-thumbnail {
    width: 220px;
    height: 124px;
    object-fit: cover;
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.3);
}

.video-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

#video-title {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

#video-meta {
    color: var(--text-muted);
    font-size: 1rem;
}

.action-area {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.primary-btn, .success-btn {
    width: 100%;
    padding: 1.2rem;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    color: white;
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
}

.primary-btn {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
}

.primary-btn:hover {
    background: linear-gradient(135deg, var(--secondary), var(--primary));
    border-color: transparent;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(221, 36, 118, 0.4);
}

.success-btn {
    background: linear-gradient(135deg, #00b09b, #96c93d);
}

.success-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 176, 155, 0.4);
}

#progress-container {
    background: rgba(0,0,0,0.3);
    padding: 1.2rem;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.05);
}

.progress-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.8rem;
    font-size: 0.95rem;
    font-weight: 500;
}

.progress-bar-bg {
    height: 8px;
    background: rgba(255,255,255,0.1);
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--secondary), var(--primary));
    transition: width 0.3s ease;
    border-radius: 4px;
}

.error-msg {
    margin-top: 1.5rem;
    color: #ff6b6b;
    background: rgba(255, 107, 107, 0.1);
    padding: 1rem 1.5rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 107, 107, 0.2);
    width: 100%;
    max-width: 700px;
    font-weight: 500;
}

@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
    }
    .video-info {
        flex-direction: column;
    }
    #video-thumbnail {
        width: 100%;
        height: auto;
        aspect-ratio: 16/9;
    }
    .search-box {
        flex-direction: column;
        background: transparent;
        border: none;
        box-shadow: none;
        gap: 1rem;
    }
    #url-input {
        background: var(--card-bg);
        border: 1px solid var(--card-border);
        border-radius: 50px;
        padding: 1rem 1.5rem;
    }
    #submit-btn {
        width: 100%;
    }
}
