@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Poppins:wght@400;600;700;800&display=swap');

:root {
    --bg-deep: #020617;
    --primary: #3b82f6;
    --primary-glow: rgba(59, 130, 246, 0.5);
    --secondary: #8b5cf6;
    --accent: #d946ef;
    --card-bg: rgba(15, 23, 42, 0.6);
    --glass-border: rgba(255, 255, 255, 0.05);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}

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

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

/* Background FX */
.bg-mesh {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: 
        radial-gradient(circle at 10% 10%, rgba(59, 130, 246, 0.1) 0%, transparent 40%),
        radial-gradient(circle at 90% 90%, rgba(139, 92, 246, 0.1) 0%, transparent 40%),
        radial-gradient(circle at 50% 50%, rgba(217, 70, 239, 0.05) 0%, transparent 60%);
}

/* Navbar */
nav {
    padding: 1.5rem 8%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--glass-border);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.logo {
    font-family: 'Poppins', sans-serif;
    font-size: 1.6rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
}

/* Layout Container */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 6rem 2rem;
    text-align: center;
}

.hero-section h1 {
    font-family: 'Poppins', sans-serif;
    font-size: 4rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    letter-spacing: -2px;
    line-height: 1.1;
}

.hero-section p {
    color: var(--text-muted);
    font-size: 1.25rem;
    max-width: 650px;
    margin: 0 auto 3.5rem;
}

/* Search UI */
.search-container {
    max-width: 750px;
    margin: 0 auto 5rem;
    display: flex;
    gap: 15px;
    position: relative;
}

.search-input {
    flex: 1;
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    padding: 1.4rem 2rem;
    border-radius: 20px;
    color: white;
    font-size: 1.15rem;
    outline: none;
    transition: var(--transition);
    backdrop-filter: blur(20px);
}

.search-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 40px var(--primary-glow);
    background: rgba(15, 23, 42, 0.8);
}

.btn-search {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border: none;
    padding: 0 2.5rem;
    border-radius: 20px;
    color: white;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-search:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 30px var(--primary-glow);
    filter: brightness(1.1);
}

/* Result Card */
#result-wrapper {
    margin-top: 3rem;
    display: none;
    animation: reveal 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes reveal {
    from { opacity: 0; transform: translateY(50px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.video-card {
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    border-radius: 32px;
    overflow: hidden;
    max-width: 850px;
    margin: 0 auto;
    display: flex;
    text-align: left;
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    transition: var(--transition);
}

.video-card:hover {
    border-color: var(--primary);
    transform: translateY(-5px);
    box-shadow: 0 20px 50px rgba(0,0,0,0.4);
}

.video-thumb {
    width: 380px;
    position: relative;
    overflow: hidden;
}

.video-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

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

.duration-badge {
    position: absolute;
    bottom: 15px;
    right: 15px;
    background: rgba(0,0,0,0.85);
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 700;
    color: white;
}

.video-content {
    padding: 2.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.video-title {
    font-family: 'Poppins', sans-serif;
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.25;
    color: #fff;
}

.video-meta {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.channel-info {
    color: var(--text-muted);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.channel-info i {
    color: var(--primary);
    font-size: 0.9rem;
}

.stats-info {
    display: flex;
    gap: 25px;
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* Skeleton Loading */
.skeleton {
    background: linear-gradient(90deg, #0f172a 25%, #1e293b 50%, #0f172a 75%);
    background-size: 200% 100%;
    animation: shimmer 1.8s infinite linear;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* History */
.history-section {
    margin-top: 8rem;
}

.history-header {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
    text-transform: uppercase;
    letter-spacing: 3px;
    font-weight: 700;
}

.history-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 25px;
}

.history-card {
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 15px;
    cursor: pointer;
    transition: var(--transition);
    text-align: left;
}

.history-card:hover {
    background: rgba(255,255,255,0.03);
    border-color: var(--primary);
    transform: translateY(-3px);
}

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

/* Toast */
.toast-msg {
    position: fixed;
    bottom: 40px;
    right: 40px;
    padding: 1.2rem 2.5rem;
    background: var(--card-bg);
    border: 1px solid var(--primary);
    border-radius: 16px;
    backdrop-filter: blur(15px);
    z-index: 2000;
    font-weight: 600;
    animation: toastIn 0.4s ease;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

@keyframes toastIn { from { transform: translateX(100px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* Responsive */
@media (max-width: 900px) {
    .video-card { flex-direction: column; }
    .video-thumb { width: 100%; height: 240px; }
    .hero-section h1 { font-size: 2.8rem; }
    .search-container { flex-direction: column; }
    .btn-search { padding: 1.4rem; }
}
