:root {
    --primary: #00ffa3;
    --primary-glow: rgba(0, 255, 163, 0.4);
    --bg-dark: #0a0c10;
    --card-bg: rgba(20, 24, 33, 0.9);
    --input-bg: rgba(255, 255, 255, 0.05);
    --text-main: #ffffff;
    --text-dim: #a0a0ba;
    --text-muted: #707080;
    --accent-blue: #00d1ff;
    --glass-border: rgba(255, 255, 255, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: 'Outfit', 'Noto Sans KR', sans-serif;
    min-height: 100vh;
    display: flex;
    justify-content: center;
}

.container {
    width: 100%;
    max-width: 900px;
    padding: 40px 20px;
}

header {
    text-align: center;
    margin-bottom: 40px;
}

h1 {
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -1px;
}

.gradient-text {
    color: var(--primary);
}

.input-area {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 40px;
}

.input-group {
    width: 100%;
}

.cf-turnstile {
    transition: all 0.4s ease;
    max-height: 100px;
    opacity: 1;
    display: flex;
    justify-content: center;
}

.cf-turnstile.ts-hidden {
    max-height: 0;
    opacity: 0;
    margin: 0;
    pointer-events: none;
    overflow: hidden;
}

input[type="text"] {
    width: 100%;
    background: var(--input-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 18px 20px;
    color: white;
    font-size: 1.1rem;
    outline: none;
    text-align: center;
    transition: all 0.3s ease;
}

input[type="text"]:focus {
    border-color: var(--primary);
}

button#fetchBtn {
    background: var(--primary);
    border: none;
    border-radius: 12px;
    padding: 18px;
    color: #000;
    font-weight: 700;
    font-size: 1.1rem;
    cursor: pointer;
    transition: transform 0.2s ease;
}

button#fetchBtn:hover {
    transform: translateY(-2px);
}

.error-message {
    color: #ff4d4d;
    font-size: 0.9rem;
    text-align: center;
}

.loader-container {
    display: flex;
    justify-content: center;
}

.loader {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    display: none;
}

@keyframes spin { to { transform: rotate(360deg); } }

.hidden { display: none; }

.content-card {
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 25px;
}

.video-info {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.channel-avatar {
    width: 44px;
    height: 44px;
    border-radius: 10px;
}

.details h2 { font-size: 1rem; font-weight: 600; }
.details p { font-size: 0.8rem; color: var(--text-dim); }

#videoLink {
    text-decoration: none;
    color: inherit;
    display: block;
    margin-bottom: 20px;
}

#videoLink h3 {
    font-size: 1.1rem;
    font-weight: 400;
    line-height: 1.4;
    transition: color 0.2s ease;
}

#videoLink:hover h3 {
    color: var(--primary);
}

.thumbnail-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 25px;
}

.thumbnail-item {
    border-radius: 12px;
    overflow: hidden;
    aspect-ratio: 16/9;
    background: #000;
    position: relative;
}

.thumbnail-item img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.thumbnail-label {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    backdrop-filter: blur(4px);
}

.download-link-btn {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: white;
    padding: 12px;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    text-decoration: none;
    display: block;
    margin-top: 10px;
    font-size: 0.9rem;
}

.download-link-btn:hover {
    background: white;
    color: black;
}

.download-btn {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: white;
    padding: 15px;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.download-btn:hover {
    background: white;
    color: black;
}

/* Footer & Modal */
footer {
    margin-top: 60px;
    padding-top: 30px;
    border-top: 1px solid var(--glass-border);
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-dim);
}

.footer-content {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

footer a {
    color: var(--text-dim);
    text-decoration: none;
    transition: color 0.2s;
}

footer a:hover {
    color: var(--primary);
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.8);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: var(--bg-dark);
    margin: 5vh auto;
    padding: 40px;
    border: 1px solid var(--glass-border);
    width: 90%;
    max-width: 700px;
    border-radius: 20px;
    position: relative;
    box-shadow: 0 0 50px rgba(0,0,0,0.8);
    max-height: 90vh;
    overflow-y: auto;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

.modal-content::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

body.modal-open {
    overflow: hidden;
}

.close {
    color: var(--text-dim);
    position: absolute;
    right: 20px;
    top: 15px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: white;
}

.modal-body {
    margin-top: 25px;
    line-height: 1.7;
    font-size: 1rem;
    color: var(--text-dim);
    text-align: left;
}

.modal-body p {
    margin-bottom: 15px;
}



/* Ads */
.ad-container {
    margin-top: 25px;
    display: flex;
    justify-content: center;
    overflow: hidden;
    min-height: 100px; /* Prevent layout shift */
}
