/* Color Palette & Variables */
:root {
    --bg-color: #121212; /* 60% - Main Background */
    --card-bg: #1e1e1e;  /* 30% - Secondary Elements */
    --accent: #ffc000;   /* 10% - SnapTube Yellow Highlight */
    --text-main: #ffffff;
    --text-muted: #a0a0a0;
    --transition: 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Navbar */
.navbar {
    padding: 20px 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--card-bg);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

.logo {
    font-size: 24px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo i {
    color: var(--accent);
}

.highlight {
    color: var(--accent);
}

/* Hero Section */
.container {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px 20px;
}

.hero-section {
    text-align: center;
    width: 100%;
    max-width: 700px;
}

.hero-section h1 {
    font-size: 2.5rem;
    line-height: 1.2;
    margin-bottom: 15px;
}

.hero-section p {
    color: var(--text-muted);
    margin-bottom: 40px;
    font-size: 1rem;
}

/* Search Box */
.search-box {
    display: flex;
    align-items: center;
    background-color: var(--card-bg);
    border-radius: 50px;
    padding: 5px 5px 5px 20px;
    border: 2px solid transparent;
    transition: var(--transition);
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.search-box:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 15px rgba(255, 192, 0, 0.2);
}

.youtube-icon {
    color: #ff0000;
    font-size: 1.5rem;
}

.search-box input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-main);
    padding: 15px;
    font-size: 1rem;
}

.search-box input::placeholder {
    color: var(--text-muted);
}

.btn-primary {
    background-color: var(--accent);
    color: #000;
    border: none;
    padding: 15px 30px;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: var(--transition);
}

.btn-primary:hover {
    transform: scale(1.05);
    background-color: #e6ad00;
}

/* Loading Animation */
.loader-container {
    margin-top: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--card-bg);
    border-top: 4px solid var(--accent);
    border-radius: 50px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.hidden {
    display: none !important;
}

/* Result Card (Preview) */
.result-card {
    margin-top: 40px;
    background-color: var(--card-bg);
    border-radius: 20px;
    padding: 20px;
    text-align: left;
    animation: slideUp 0.5s ease;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Mobile Responsive */
@media (max-width: 600px) {
    .hero-section h1 { font-size: 2rem; }
    .search-box { flex-direction: column; border-radius: 20px; padding: 15px; gap: 15px; }
    .youtube-icon { display: none; }
    .search-box input { width: 100%; text-align: center; padding: 10px; }
    .btn-primary { width: 100%; justify-content: center; }
}
/* Advanced Result Card & Grid Utilities (Mobile-First) */
.result-wrapper {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.thumbnail-container {
    position: relative;
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0,0,0,0.5);
}

.thumbnail-container img {
    width: 100%;
    display: block;
    object-fit: cover;
}

.duration-badge {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0,0,0,0.8);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
}

.meta-container {
    flex: 1;
}

.video-title {
    font-size: 1.2rem;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 20px;
    color: var(--text-main);
}

.section-title {
    font-size: 0.95rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.button-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
}

.dl-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 10px;
    background: #252525;
    color: #fff;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 8px;
    border: 1px solid transparent;
    transition: var(--transition);
    text-align: center;
}

.video-btn { border-color: rgba(255,192,0,0.3); }
.video-btn:hover { background: var(--accent); color: #000; transform: translateY(-2px); }

.audio-btn { border-color: rgba(76,175,80,0.3); }
.audio-btn:hover { background: #4CAF50; color: #fff; transform: translateY(-2px); }

.hd-badge {
    background: #ff0000;
    color: #fff;
    font-size: 0.65rem;
    padding: 1px 4px;
    border-radius: 3px;
    margin-left: 4px;
}

/* Tablet & Desktop Responsive Scaling */
@media (min-width: 768px) {
    .result-wrapper {
        flex-direction: row;
        align-items: flex-start;
    }
    .thumbnail-container {
        width: 280px;
        min-width: 280px;
    }
    .video-title {
        font-size: 1.4rem;
    }
    .button-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    }
}