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

:root {
    --tt-red: #FE2C55;
    --tt-cyan: #25F4EE;
    --tt-black: #010101;
    --tt-dark: #121212;
    --tt-card: #1C1C1C;
    --tt-border: #2A2A2A;
    --tt-text: #FFFFFF;
    --tt-muted: #8A8A8A;
    --tt-green: #25C77A;
    --tt-glow-red: rgba(254, 44, 85, 0.35);
    --tt-glow-cyan: rgba(37, 244, 238, 0.25);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--tt-black);
    color: var(--tt-text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 30px 20px 60px;
    position: relative;
    overflow-x: hidden;
}

/* Animated background grid */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(37, 244, 238, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(254, 44, 85, 0.03) 1px, transparent 1px);
    background-size: 60px 60px;
    pointer-events: none;
    z-index: 0;
}

/* Ambient blobs */
body::after {
    content: '';
    position: fixed;
    top: -200px;
    right: -200px;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(254,44,85,0.08) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
    animation: drift 8s ease-in-out infinite alternate;
}

@keyframes drift {
    from { transform: translate(0, 0) scale(1); }
    to   { transform: translate(-40px, 40px) scale(1.1); }
}

.container {
    max-width: 680px;
    width: 100%;
    position: relative;
    z-index: 1;
}

/* ── HEADER ── */
.header {
    text-align: center;
    margin-bottom: 36px;
    animation: slideDown 0.6s cubic-bezier(.16,1,.3,1) both;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-24px); }
    to   { opacity: 1; transform: translateY(0); }
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 12px;
}

.logo-icon {
    width: 52px;
    height: 52px;
    position: relative;
    flex-shrink: 0;
}

/* TikTok note icon made in CSS */
.logo-icon::before,
.logo-icon::after {
    content: '♪';
    position: absolute;
    font-size: 36px;
    font-weight: 900;
    line-height: 1;
}

.logo-icon::before {
    color: var(--tt-cyan);
    top: 2px;
    left: 2px;
    filter: blur(0px);
}

.logo-icon::after {
    color: var(--tt-red);
    top: 4px;
    left: 4px;
    animation: chromaShift 3s ease-in-out infinite;
}

@keyframes chromaShift {
    0%, 100% { transform: translate(0, 0); opacity: 1; }
    50%       { transform: translate(2px, -1px); opacity: 0.8; }
}

.logo h1 {
    font-size: 2.2rem;
    font-weight: 900;
    letter-spacing: -1px;
    background: linear-gradient(135deg, #fff 30%, var(--tt-cyan) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    line-height: 1;
}

.logo h1 span {
    background: linear-gradient(135deg, var(--tt-red) 0%, #ff6b8a 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.subtitle {
    font-size: 0.9rem;
    color: var(--tt-muted);
    font-weight: 400;
    letter-spacing: 0.2px;
}

/* ── MAIN CARD ── */
.main-card {
    background: var(--tt-card);
    border-radius: 20px;
    padding: 28px;
    border: 1px solid var(--tt-border);
    box-shadow:
        0 0 0 1px rgba(255,255,255,0.04),
        0 24px 64px rgba(0,0,0,0.6);
    animation: slideUp 0.7s cubic-bezier(.16,1,.3,1) 0.1s both;
    transition: border-color 0.3s ease;
}

.main-card:hover {
    border-color: rgba(254, 44, 85, 0.2);
}

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

/* ── URL INPUT ── */
.url-input-section {
    margin-bottom: 22px;
}

.url-input-section label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--tt-muted);
    margin-bottom: 10px;
}

.input-group {
    display: flex;
    gap: 10px;
    align-items: stretch;
}

.input-group input {
    flex: 1;
    padding: 14px 18px;
    background: var(--tt-dark);
    border: 1.5px solid var(--tt-border);
    border-radius: 12px;
    font-size: 14px;
    font-family: 'DM Mono', monospace;
    color: var(--tt-text);
    transition: all 0.25s ease;
}

.input-group input:focus {
    outline: none;
    border-color: var(--tt-cyan);
    box-shadow: 0 0 0 3px rgba(37, 244, 238, 0.1);
    background: #1a1a1a;
}

.input-group input::placeholder {
    color: #444;
    font-size: 12px;
}

.btn-primary {
    padding: 14px 22px;
    background: var(--tt-red);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
    font-family: 'Outfit', sans-serif;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.btn-primary::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.15) 0%, transparent 60%);
    pointer-events: none;
}

.btn-primary:hover {
    background: #ff1a42;
    transform: translateY(-1px);
    box-shadow: 0 8px 24px var(--tt-glow-red);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ── TOGGLE TABS ── */
.options-section {
    margin-bottom: 22px;
}

.option-buttons {
    display: flex;
    background: var(--tt-dark);
    border-radius: 12px;
    padding: 4px;
    gap: 4px;
    border: 1px solid var(--tt-border);
}

.option-btn {
    flex: 1;
    padding: 11px 16px;
    background: transparent;
    border: none;
    border-radius: 9px;
    font-size: 14px;
    font-weight: 600;
    font-family: 'Outfit', sans-serif;
    cursor: pointer;
    color: var(--tt-muted);
    transition: all 0.25s ease;
    letter-spacing: 0.2px;
}

.option-btn:hover:not(.active) {
    color: var(--tt-text);
    background: rgba(255,255,255,0.05);
}

.option-btn.active {
    background: var(--tt-red);
    color: white;
    box-shadow: 0 4px 16px var(--tt-glow-red);
}

/* ── RESULT SECTION ── */
.result-section {
    margin-top: 20px;
    animation: fadeUp 0.45s cubic-bezier(.16,1,.3,1) both;
}

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

.media-preview {
    background: var(--tt-dark);
    border-radius: 14px;
    padding: 20px;
    border: 1px solid var(--tt-border);
}

#previewContainer video,
#previewContainer img {
    max-width: 100%;
    border-radius: 10px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}

#previewContainer video {
    max-height: 380px;
    width: 100%;
    background: #000;
}

#previewContainer audio {
    width: 100%;
    margin-top: 14px;
    border-radius: 8px;
}

/* Custom audio player background */
#previewContainer audio::-webkit-media-controls-panel {
    background: var(--tt-card);
}

.media-info {
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}

#infoText {
    color: var(--tt-muted);
    font-size: 13px;
    line-height: 1.6;
    text-align: center;
    width: 100%;
}

#infoText strong {
    color: var(--tt-text);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.download-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 13px 28px;
    background: transparent;
    color: var(--tt-cyan);
    text-decoration: none;
    border-radius: 12px;
    font-weight: 700;
    font-family: 'Outfit', sans-serif;
    font-size: 14px;
    border: 1.5px solid var(--tt-cyan);
    transition: all 0.25s ease;
    letter-spacing: 0.3px;
}

.download-btn:hover {
    background: var(--tt-cyan);
    color: var(--tt-black);
    box-shadow: 0 6px 24px var(--tt-glow-cyan);
    transform: translateY(-2px);
}

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

/* ── ERROR MESSAGE ── */
.error-message {
    margin-top: 16px;
    padding: 13px 16px;
    background: rgba(254, 44, 85, 0.1);
    color: #ff8fa3;
    border-radius: 10px;
    text-align: center;
    border: 1px solid rgba(254, 44, 85, 0.25);
    font-size: 14px;
    font-weight: 500;
    animation: shake 0.4s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%       { transform: translateX(-6px); }
    40%       { transform: translateX(6px); }
    60%       { transform: translateX(-4px); }
    80%       { transform: translateX(4px); }
}

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

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

/* ── FEATURES ── */
.features {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-top: 24px;
    animation: slideUp 0.7s cubic-bezier(.16,1,.3,1) 0.2s both;
}

.feature {
    text-align: center;
    padding: 18px 10px;
    background: var(--tt-card);
    border-radius: 14px;
    border: 1px solid var(--tt-border);
    transition: all 0.25s ease;
    cursor: default;
}

.feature:hover {
    border-color: var(--tt-red);
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(254,44,85,0.1);
}

.feature span {
    font-size: 26px;
    display: block;
    margin-bottom: 8px;
}

.feature p {
    font-size: 12px;
    font-weight: 600;
    color: var(--tt-muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

/* ── FOOTER ── */
footer {
    margin-top: 40px;
    width: 100%;
    max-width: 680px;
    position: relative;
    z-index: 1;
    animation: slideUp 0.7s cubic-bezier(.16,1,.3,1) 0.3s both;
}

.footer-content {
    text-align: center;
    color: var(--tt-muted);
    padding: 28px 20px;
    border-top: 1px solid var(--tt-border);
}

.wolf-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 8px;
}

.wolf-icon-small {
    font-size: 20px;
}

.powered-by {
    font-size: 15px;
    font-weight: 500;
    color: var(--tt-text);
    letter-spacing: 0.5px;
}

.wolf-tech {
    color: var(--tt-red);
    font-weight: 800;
    letter-spacing: 1px;
}

.tagline {
    font-size: 12px;
    opacity: 0.6;
    margin-bottom: 16px;
}

.disclaimer {
    font-size: 11px;
    opacity: 0.5;
    max-width: 460px;
    margin: 0 auto 16px;
    line-height: 1.6;
}

.footer-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-bottom: 16px;
    font-size: 12px;
}

.footer-links a {
    color: var(--tt-muted);
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-links a:hover {
    color: var(--tt-cyan);
}

.footer-links span {
    opacity: 0.3;
}

.copyright {
    font-size: 11px;
    opacity: 0.35;
}

/* ── RESPONSIVE ── */
@media (max-width: 600px) {
    body {
        padding: 20px 14px 50px;
    }

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

    .main-card {
        padding: 20px;
    }

    .input-group {
        flex-direction: column;
    }

    .btn-primary {
        width: 100%;
        justify-content: center;
    }

    .features {
        grid-template-columns: repeat(2, 1fr);
    }

    .wolf-icon-small {
        display: none;
    }

    .footer-links {
        flex-wrap: wrap;
    }
}

@media (max-width: 360px) {
    .logo h1 {
        font-size: 1.4rem;
    }

    .features {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
}