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

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

:root {
    --pink: #fe2c55;
    --cyan: #25f4ee;
    --dark-1: #08080e;
    --dark-2: #10101a;
    --white: #ffffff;
    --gray: #8888a0;
    --glass-bg: rgba(255, 255, 255, 0.04);
    --glass-border: rgba(255, 255, 255, 0.08);

    /* Colores por plataforma */
    --tiktok: #fe2c55;
    --facebook: #1877f2;
    --instagram: #e4405f;
    --twitter: #ffffff;
    --youtube: #ff0000;
    --threads: #101010;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--dark-1);
    min-height: 100vh;
    color: var(--white);
    overflow-x: hidden;
}

/* ===== Fondo animado ===== */
.bg-orbs {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.3;
    animation: float 10s ease-in-out infinite;
}

.orb-1 {
    width: 500px;
    height: 500px;
    background: var(--pink);
    top: -15%;
    left: -10%;
}

.orb-2 {
    width: 400px;
    height: 400px;
    background: var(--cyan);
    bottom: -15%;
    right: -10%;
    animation-delay: -4s;
}

.orb-3 {
    width: 300px;
    height: 300px;
    background: #8b5cf6;
    top: 40%;
    right: 20%;
    animation-delay: -7s;
    opacity: 0.2;
}

.orb-4 {
    width: 250px;
    height: 250px;
    background: var(--facebook);
    bottom: 30%;
    left: 10%;
    animation-delay: -2s;
    opacity: 0.15;
}

@keyframes float {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    33% {
        transform: translate(40px, -30px) scale(1.05);
    }

    66% {
        transform: translate(-30px, 20px) scale(0.95);
    }
}

/* ===== Main container ===== */
.main-container {
    position: relative;
    z-index: 1;
    max-width: 1100px;
    margin: 0 auto;
    padding: 40px 24px 60px;
}

/* ===== Header ===== */
.header {
    text-align: center;
    margin-bottom: 48px;
    animation: fadeUp 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.header-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 16px;
    background: linear-gradient(135deg, var(--pink), var(--cyan));
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 30px rgba(254, 44, 85, 0.25);
}

.header-icon svg {
    width: 28px;
    height: 28px;
    color: white;
}

.header h1 {
    font-size: 2.2rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--cyan), var(--white) 40%, var(--pink));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -1px;
    margin-bottom: 8px;
}

.header p {
    color: var(--gray);
    font-size: 1rem;
    font-weight: 400;
}

/* ===== Grid de secciones ===== */
.sections-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
}

/* ===== Tarjeta de plataforma ===== */
.platform-card {
    background: var(--glass-bg);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 28px;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    animation: fadeUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) backwards;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
}

.platform-card:nth-child(1) {
    animation-delay: 0.05s;
}

.platform-card:nth-child(2) {
    animation-delay: 0.1s;
}

.platform-card:nth-child(3) {
    animation-delay: 0.15s;
}

.platform-card:nth-child(4) {
    animation-delay: 0.2s;
}

.platform-card:nth-child(5) {
    animation-delay: 0.25s;
}

.platform-card:hover {
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.3);
}

/* ===== Platform header ===== */
.platform-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 20px;
}

.platform-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.platform-icon svg {
    width: 22px;
    height: 22px;
}

/* Iconos por plataforma */
.tiktok-icon {
    background: linear-gradient(135deg, #25f4ee, #fe2c55);
    color: white;
}

.facebook-icon {
    background: linear-gradient(135deg, #1877f2, #42a5f5);
    color: white;
}

.instagram-icon {
    background: linear-gradient(135deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
    color: white;
}

.twitter-icon {
    background: linear-gradient(135deg, #1a1a2e, #2d2d44);
    color: white;
}

.youtube-icon {
    background: linear-gradient(135deg, #ff0000, #cc0000);
    color: white;
}

.threads-icon {
    background: linear-gradient(135deg, #000000, #333333);
    color: white;
}

.platform-info h2 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--white);
    line-height: 1.2;
}

.platform-badge {
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--gray);
    background: rgba(255, 255, 255, 0.06);
    padding: 2px 8px;
    border-radius: 6px;
    display: inline-block;
    margin-top: 2px;
}

/* ===== Input ===== */
.input-wrapper {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    transition: all 0.3s ease;
    margin-bottom: 12px;
    overflow: hidden;
}

.input-wrapper:focus-within {
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.07);
}

/* Colores de foco por plataforma */
[data-platform="tiktok"] .input-wrapper:focus-within {
    border-color: var(--tiktok);
    box-shadow: 0 0 0 2px rgba(254, 44, 85, 0.12);
}

[data-platform="facebook"] .input-wrapper:focus-within {
    border-color: var(--facebook);
    box-shadow: 0 0 0 2px rgba(24, 119, 242, 0.12);
}

[data-platform="instagram"] .input-wrapper:focus-within {
    border-color: var(--instagram);
    box-shadow: 0 0 0 2px rgba(228, 64, 95, 0.12);
}

[data-platform="twitter"] .input-wrapper:focus-within {
    border-color: var(--twitter);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.08);
}

[data-platform="youtube"] .input-wrapper:focus-within {
    border-color: var(--youtube);
    box-shadow: 0 0 0 2px rgba(255, 0, 0, 0.12);
}

[data-platform="threads"] .input-wrapper:focus-within {
    border-color: rgba(255, 255, 255, 0.6);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.12);
}

.input-icon {
    padding-left: 14px;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.input-icon svg {
    width: 16px;
    height: 16px;
    color: var(--gray);
    transition: color 0.3s ease;
}

.url-input {
    width: 100%;
    padding: 13px 14px 13px 10px;
    background: transparent;
    border: none;
    outline: none;
    color: var(--white);
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
}

.url-input::placeholder {
    color: rgba(136, 136, 160, 0.5);
    font-size: 0.82rem;
}

/* ===== Format Selector ===== */
.format-select {
    width: 100%;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    color: var(--white);
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    outline: none;
    appearance: none;
    cursor: pointer;
    transition: all 0.3s ease;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='rgba(255, 255, 255, 0.5)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 16px;
}

.format-select:focus,
.format-select:hover {
    border-color: rgba(255, 255, 255, 0.2);
    background-color: rgba(255, 255, 255, 0.06);
}

.format-select option {
    background: var(--dark-2);
    color: var(--white);
    padding: 10px;
}

/* ===== Botón de descargar ===== */
.btn-download {
    width: 100%;
    padding: 13px 20px;
    border: none;
    border-radius: 12px;
    color: var(--white);
    font-family: 'Inter', sans-serif;
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
    z-index: 1;
}

/* Efecto de barra de carga a rayas */
.btn-download::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 200%;
    height: 100%;
    background: repeating-linear-gradient(-45deg,
            rgba(255, 255, 255, 0.15),
            rgba(255, 255, 255, 0.15) 15px,
            transparent 15px,
            transparent 30px);
    background-size: 42.42px 100%;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s;
}

.btn-download.loading::before {
    opacity: 1;
    animation: moveStripes 1s linear infinite;
}

@keyframes moveStripes {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-42.42px);
    }
}

/* Colores de botón por plataforma */
[data-platform="tiktok"] .btn-download {
    background: linear-gradient(135deg, #fe2c55, #d91a40);
}

[data-platform="facebook"] .btn-download {
    background: linear-gradient(135deg, #1877f2, #1565c0);
}

[data-platform="instagram"] .btn-download {
    background: linear-gradient(135deg, #e4405f, #c62842);
}

[data-platform="twitter"] .btn-download {
    background: linear-gradient(135deg, #333350, #1a1a2e);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

[data-platform="youtube"] .btn-download {
    background: linear-gradient(135deg, #ff0000, #cc0000);
}

[data-platform="threads"] .btn-download {
    background: linear-gradient(135deg, #333, #000);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.btn-download:hover:not(:disabled) {
    transform: translateY(-1px);
    filter: brightness(1.1);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.3);
}

.btn-download:active:not(:disabled) {
    transform: translateY(0);
}

.btn-download:disabled {
    cursor: not-allowed;
}

.btn-download:disabled:not(.loading) {
    opacity: 0.65;
}

.btn-download .btn-icon svg {
    width: 18px;
    height: 18px;
}

/* ===== Spinner ===== */
.spinner {
    width: 18px;
    height: 18px;
    border: 2.5px solid rgba(255, 255, 255, 0.3);
    border-top-color: var(--white);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ===== Mensajes ===== */
.message {
    margin-top: 12px;
    padding: 0;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: 500;
    display: none;
    align-items: center;
    gap: 8px;
    animation: messageSlide 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.message.show {
    display: flex;
    padding: 10px 14px;
}

.message.error {
    background: rgba(254, 44, 85, 0.1);
    border: 1px solid rgba(254, 44, 85, 0.2);
    color: #ff6b8a;
}

.message.success {
    background: rgba(37, 244, 238, 0.08);
    border: 1px solid rgba(37, 244, 238, 0.15);
    color: var(--cyan);
}

.message.info {
    background: rgba(139, 92, 246, 0.08);
    border: 1px solid rgba(139, 92, 246, 0.15);
    color: #b794f6;
}

.message svg {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
}

@keyframes messageSlide {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== Footer ===== */
.footer {
    text-align: center;
    margin-top: 40px;
    color: rgba(233, 233, 240, 0.89);
    font-size: 0.75rem;
}

/* ===== Animations ===== */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(24px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== Responsive ===== */
@media (max-width: 700px) {
    .main-container {
        padding: 28px 16px 48px;
    }

    .header h1 {
        font-size: 1.7rem;
    }

    .sections-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .platform-card {
        padding: 22px;
    }

    .orb {
        opacity: 0.2;
    }
}