:root {
    --primary-color: #ff0000;
    --primary-dark: #cc0000;
    --accent-color: #282828;
    --bg-color: #0f0f0f;
    --card-bg: #1f1f1f;
    --text-primary: #ffffff;
    --text-secondary: #aaaaaa;
    --border-radius: 16px;
    --shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-color);
    display: flex;
    flex-direction: column;
    /* Force vertical stacking */
    align-items: center;
    min-height: 100vh;
    padding: 0;
    color: var(--text-primary);
    overflow-x: hidden;
}

/* Scrollable Content Area */
.content-scroll {
    width: 90%;
    margin: 0 auto;
    flex: 1;
    overflow-y: auto;
    padding: 20px 0 100px 0;
    /* Add bottom padding to prevent content from being hidden behind nav */
    display: flex;
    flex-direction: column;
    gap: 15px;
    scrollbar-width: none;
    /* Hide scrollbar for cleaner look */
}

.content-scroll::-webkit-scrollbar {
    display: none;
    /* Hide scrollbar for Chrome/Safari */
}

.container {
    width: 100%;
    max-width: 100%;
    height: 100vh;
    /* Force full viewport height */
    overflow: hidden;
    /* Prevent body scroll, force internal scroll */
    display: flex;
    flex-direction: column;
    gap: 0;
    /* Remove gap, handle in content-scroll */
    padding-bottom: 0;
    position: relative;
}

/* App Header */
.app-header {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    padding: 20px 0 10px;
}

.app-header i {
    color: var(--primary-color);
    font-size: 2rem;
}

.app-header span {
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

/* Search Card */
.search-card {
    background: var(--card-bg);
    padding: 20px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    text-align: center;
    border: 1px solid #333;
}

.search-box {
    display: flex;
    gap: 10px;
    background: #2a2a2a;
    padding: 5px;
    border-radius: 12px;
    border: 1px solid #333;
    transition: var(--transition);
}

.search-box:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 0, 0, 0.15);
}

input[type="text"] {
    flex: 1;
    padding: 12px 15px;
    border: none;
    background: transparent;
    font-size: 1rem;
    outline: none;
    color: var(--text-primary);
}

button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    width: 45px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.1rem;
    transition: var(--transition);
    display: flex;
    justify-content: center;
    align-items: center;
}

button:hover {
    background-color: var(--primary-dark);
}

/* Result Card */
.result-card {
    margin-top: 10px;
    animation: slideIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.profile-layout {
    display: flex;
    /* Restored flex display */
    background: var(--card-bg);
    padding: 20px;
    border-radius: var(--border-radius);
    border: 1px solid #333;
    text-align: left;
    flex-direction: row;
    align-items: flex-start;
    gap: 20px;
}

/* Circular Video Profile */
/* Square Video Thumbnail */
.video-circle-wrapper {
    width: 120px;
    height: 120px;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    border: 1px solid #333;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    flex-shrink: 0;
    /* No animation, square shape */
}

.video-circle-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.play-icon-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.play-icon-overlay i {
    font-size: 1.2rem;
    color: #fff;
}

.video-info {
    width: 100%;
}

.video-info h2 {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 10px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.meta-info {
    margin-bottom: 25px;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 0.85rem;
    background: #2a2a2a;
    color: #ddd;
}



/* Button Main (Not Fixed) */
.download-btn-main {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    background-color: var(--primary-color);
    color: white;
    text-decoration: none;
    padding: 16px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 1rem;
    text-transform: uppercase;
    width: 100%;
    transition: var(--transition);
    box-shadow: 0 4px 15px rgba(255, 0, 0, 0.2);
}

.download-btn-main:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 0, 0, 0.3);
}

/* Ad Areas */
.ad-area {
    margin: 20px 0;
    text-align: center;
    width: 100%;
    background: rgba(255, 255, 255, 0.03);
    padding: 10px;
    border-radius: 8px;
    /* Min height to prevent jump if empty */
    min-height: 10px;
}

.ad-area-footer {
    text-align: center;
    margin-top: 20px;
    padding: 10px;
    border-top: 1px solid #222;
}

/* Utilities */
.hidden {
    display: none !important;
}

#error {
    color: #ff6b6b;
    margin-top: 15px;
    font-size: 0.9rem;
    background: rgba(255, 107, 107, 0.1);
    padding: 10px;
    border-radius: 8px;
}

/* Loading Spinner */
#loading {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.spinner {
    width: 25px;
    height: 25px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spinLoader 0.8s ease-in-out infinite;
}

@keyframes spinLoader {
    to {
        transform: rotate(360deg);
    }
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.slideIn {
    animation: slideIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Bottom Navigation */
.bottom-nav {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 80px;
    /* Taller for better touch targets */
    background: rgba(20, 20, 20, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    display: flex;
    justify-content: space-evenly;
    /* Better spacing */
    align-items: center;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    z-index: 100;
    padding-bottom: 10px;
    /* Safe area for swipe bar */
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.5);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    color: #FFFFFF;
    /* Pure White */
    font-size: 0.9rem;
    /* Larger Text */
    font-weight: 500;
    transition: 0.3s;
    padding: 10px;
    width: 70px;
}

.nav-item i {
    font-size: 1.6rem;
    /* Larger Icons */
    margin-bottom: 4px;
    transition: 0.3s;
    color: inherit;
}

/* Active State */
.nav-item.active {
    color: #FFFFFF;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.6);
}

.nav-item.active i {
    transform: translateY(-4px);
    filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.6));
}

.nav-item.active::after {
    content: '';
    position: absolute;
    bottom: 5px;
    width: 4px;
    height: 4px;
    background: #FFFFFF;
    border-radius: 50%;
    box-shadow: 0 0 10px #FFFFFF;
}

.nav-item:hover:not(.active) {
    color: #FFFFFF;
    background: rgba(255, 255, 255, 0.05);
}

/* Desktop Adjustments */
@media (min-width: 768px) {
    .container {
        align-items: center;
    }

    .logo-area-mob {
        display: none;
    }

    .logo-area-desk {
        display: block;
    }

    .search-card {
        padding: 40px;
    }

    .search-card {
        padding: 40px;
    }

    /* Keep same size on desktop, or adjust if needed */
    .video-circle-wrapper {
        width: 140px;
        height: 140px;
    }
}

/* Countdown Processing Bar */
.processing-bar {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
    position: relative;
    margin-bottom: 8px;
}

.processing-fill {
    height: 100%;
    background: var(--primary-color);
    width: 0%;
    border-radius: 3px;
    transition: width 0.1s linear;
    box-shadow: 0 0 10px var(--primary-color);
}