:root {
    --bg-color: #ffffff;
    --surface-color: #ffffff;
    --text-primary: #161823;
    --text-secondary: rgba(22, 24, 35, 0.65);
    --primary-color: #fe2c55; /* TikTok Pink */
    --primary-hover: #e0244b;
    --accent-color: #25f4ee; /* TikTok Cyan */
    --input-bg: rgba(22, 24, 35, 0.05); /* Gris muy suave para el input */
    --border-color: rgba(22, 24, 35, 0.12);
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

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

body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
}

.container {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.navbar {
    padding: 1.2rem 0;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-color);
    display: flex;
    justify-content: center;
}

.logo {
    font-size: 1.8rem;
    font-weight: 900;
    color: var(--text-primary);
    letter-spacing: -1px;
    /* Efecto anaglifo / glitch adaptado a fondo blanco */
    text-shadow: 2px 0 var(--accent-color), -2px 0 var(--primary-color);
    text-align: center;
    position: relative;
    /* Evitar que el text-shadow de la misma capa ensucie, añadimos un z-index visual con color oscuro */
}

.main-content {
    flex: 1;
    padding: 3rem 0;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.hero {
    text-align: center;
    margin-bottom: 1.5rem;
}

.hero-title {
    font-size: 2.25rem;
    font-weight: 800;
    margin-bottom: 0.75rem;
    line-height: 1.1;
    letter-spacing: -1px;
}

.hero-subtitle {
    color: var(--text-secondary);
    font-size: 1.05rem;
    max-width: 90%;
    margin: 0 auto;
}

.downloader-section {
    background: var(--surface-color);
    border-radius: 12px;
    padding: 2rem 1.5rem;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 12px rgba(0,0,0,0.03);
}

.download-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

input[type="url"] {
    width: 100%;
    padding: 1.1rem 1.25rem;
    border-radius: 8px;
    border: 1px solid transparent;
    background: var(--input-bg);
    color: var(--text-primary);
    font-size: 1rem;
    outline: none;
    transition: all 0.2s ease;
}

input[type="url"]:focus {
    border-color: rgba(22, 24, 35, 0.2);
    background: rgba(22, 24, 35, 0.08);
}
input[type="url"]::placeholder {
    color: rgba(22, 24, 35, 0.4);
}

.btn-primary, .btn-success {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    padding: 1.1rem;
    border: none;
    border-radius: 8px;
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.1s, background-color 0.2s;
    color: #ffffff;
}

.btn-primary {
    background-color: var(--primary-color);
}
.btn-primary:hover {
    background-color: var(--primary-hover);
}
.btn-primary:active, .btn-success:active {
    transform: scale(0.97);
}
.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background-color: #ffa3b4; /* Tono atenuado del primary en modo claro */
}

.btn-success {
    background-color: var(--text-primary);
    color: #ffffff; /* Texto blanco en botón negro */
    text-decoration: none;
    margin-top: 1.2rem;
}
.btn-success:hover {
    background-color: rgba(22, 24, 35, 0.85); /* Negro ligeramente transparente */
}

/* Spinner (Va dentro del botón rojo, por lo tanto usamos blanco) */
.spinner {
    border: 3px solid rgba(255,255,255,0.3);
    border-top: 3px solid #fff;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    animation: spin 0.8s linear infinite;
    display: inline-block;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.hidden {
    display: none !important;
}

/* Ads Placeholders */
.ad-container {
    width: 100%;
    margin: 1rem 0;
}

/* Results Section */
.result-section {
    animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.result-card {
    background: var(--surface-color);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 12px rgba(0,0,0,0.03);
}

.result-thumbnail {
    width: 100%;
    height: 280px;
    object-fit: cover;
    background: #f1f1f2;
}

.result-info {
    padding: 1.5rem;
}

.result-info h3 {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    word-break: break-word;
    line-height: 1.4;
    color: var(--text-primary);
}

.badge {
    display: inline-block;
    padding: 0.25rem 0.6rem;
    background: rgba(22, 24, 35, 0.06);
    color: var(--text-secondary);
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.error-message {
    margin-top: 1rem;
    padding: 1rem;
    background: rgba(254, 44, 85, 0.08); /* Fondo rojo muy sutil */
    border-left: 3px solid var(--primary-color);
    color: #e0244b; /* Texto rojo oscuro para mejor legibilidad en light mode */
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 500;
}

.footer {
    text-align: center;
    padding: 2rem 0;
    color: var(--text-secondary);
    font-size: 0.85rem;
    border-top: 1px solid var(--border-color);
}

/* Responsive */
@media (min-width: 640px) {
    .download-form {
        flex-direction: row;
        align-items: stretch;
    }
    input[type="url"] {
        flex: 1;
    }
    .btn-primary {
        width: auto;
        padding: 0 2rem;
    }
}
