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

:root {
    --primary: #8b5cf6;
    --primary-dark: #7c3aed;
    --primary-light: #a78bfa;
    --secondary: #ec4899;
    --accent: #f59e0b;
    --success: #10b981;
    --danger: #ef4444;
    --bg-primary: #0c0c16;
    --bg-secondary: #151522;
    --bg-card: rgba(22, 22, 38, 0.85);
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --radius: 24px;
    --radius-sm: 16px;
    --radius-xs: 12px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Poppins', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    width: 400px;
    height: 400px;
    background: var(--primary);
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.15;
    top: -100px;
    left: -100px;
    pointer-events: none;
    z-index: 0;
}

body::after {
    content: '';
    position: fixed;
    width: 350px;
    height: 350px;
    background: var(--secondary);
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.15;
    bottom: -80px;
    right: -80px;
    pointer-events: none;
    z-index: 0;
}

/* Header */
.app-header {
    background: var(--bg-card);
    backdrop-filter: blur(24px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding: 20px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 16px;
}

.logo {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.header-text h1 {
    font-size: 24px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-light), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-text p {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* Container */
.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
    z-index: 1;
}

/* Platform Selector */
.platform-selector {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 4px;
    margin-bottom: 24px;
    scrollbar-width: none;
}

.platform-selector::-webkit-scrollbar {
    display: none;
}

.platform-btn {
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.platform-btn:hover {
    background: rgba(139, 92, 246, 0.1);
    border-color: var(--primary);
    color: var(--text-primary);
}

.platform-btn.active {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-color: var(--primary);
    color: white;
}

.platform-btn svg {
    flex-shrink: 0;
}

/* Input Section */
.input-section {
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 24px;
}

.input-wrapper {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.input-wrapper input {
    flex: 1;
    background: var(--bg-secondary);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    color: var(--text-primary);
    font-size: 14px;
    font-family: 'Poppins', sans-serif;
    transition: var(--transition);
}

.input-wrapper input:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(139, 92, 246, 0.05);
}

.input-wrapper input::placeholder {
    color: var(--text-muted);
}

.paste-btn {
    background: var(--bg-secondary);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-sm);
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.paste-btn:hover {
    background: rgba(139, 92, 246, 0.1);
    border-color: var(--primary);
    color: var(--primary);
    transform: scale(1.05);
}

.download-btn {
    width: 100%;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border: none;
    border-radius: var(--radius-sm);
    padding: 14px 20px;
    color: white;
    font-size: 15px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    transition: var(--transition);
}

.download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(139, 92, 246, 0.4);
}

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

/* Loading */
.loading {
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius);
    padding: 40px 20px;
    text-align: center;
    margin-bottom: 24px;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(139, 92, 246, 0.2);
    border-top-color: var(--primary);
    border-radius: 50%;
    margin: 0 auto 16px;
    animation: spin 0.8s linear infinite;
}

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

.loading p {
    color: var(--text-secondary);
    font-size: 14px;
}

/* Result Section */
.result-section {
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 24px;
}

/* TikTok Card */
.tiktok-card {
    margin-bottom: 20px;
}

.tiktok-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.tiktok-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid var(--primary);
    object-fit: cover;
}

.tiktok-user-info h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.tiktok-user-info p {
    font-size: 13px;
    color: var(--text-secondary);
}

.tiktok-video-container {
    position: relative;
    width: 100%;
    max-height: 600px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: #000;
    margin-bottom: 16px;
}

.tiktok-video-container video {
    width: 100%;
    height: 100%;
    max-height: 600px;
    object-fit: contain;
    display: block;
}

.video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.3);
    cursor: pointer;
    transition: var(--transition);
}

.video-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.play-btn {
    background: rgba(139, 92, 246, 0.9);
    border: none;
    border-radius: 50%;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    backdrop-filter: blur(10px);
}

.play-btn:hover {
    background: rgba(139, 92, 246, 1);
    transform: scale(1.1);
}

/* TikTok Image Slider Styles */
.tiktok-image-slider {
    width: 100%;
    aspect-ratio: 9/16;
    max-height: 600px;
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--bg-secondary);
}

.slider-container {
    width: 100%;
    height: 100%;
    position: relative;
}

.slide {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
    display: flex;
    align-items: center;
    justify-content: center;
}

.slide.active {
    opacity: 1;
    z-index: 1;
}

.slide img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: var(--bg-secondary);
}

.slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: white;
    z-index: 10;
    transition: var(--transition);
}

.slider-btn:hover {
    background: rgba(0, 0, 0, 0.7);
    transform: translateY(-50%) scale(1.1);
}

.slider-btn.prev {
    left: 12px;
}

.slider-btn.next {
    right: 12px;
}

.slider-dots {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 10;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    transition: var(--transition);
}

.dot:hover {
    background: rgba(255, 255, 255, 0.6);
    transform: scale(1.2);
}

.dot.active {
    background: white;
    width: 24px;
    border-radius: 4px;
}

.tiktok-caption {
    margin-bottom: 16px;
}

.tiktok-caption p {
    font-size: 14px;
    color: var(--text-primary);
    line-height: 1.6;
    word-wrap: break-word;
}

.tiktok-stats {
    display: flex;
    gap: 20px;
    padding: 16px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
}

.stat-item svg {
    color: var(--primary-light);
}

.stat-item span {
    color: var(--text-primary);
}

.tiktok-published {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
}

.tiktok-published svg {
    color: var(--text-muted);
    flex-shrink: 0;
}

.tiktok-published span {
    font-size: 13px;
    color: var(--text-secondary);
}

.tiktok-music {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
}

.tiktok-music svg {
    color: var(--primary-light);
    flex-shrink: 0;
}

.tiktok-music span {
    font-size: 13px;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.video-preview {
    display: flex;
    gap: 16px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    margin-bottom: 20px;
}

.video-preview img {
    width: 120px;
    height: 90px;
    border-radius: var(--radius-xs);
    object-fit: cover;
    background: var(--bg-secondary);
}

.preview-info {
    flex: 1;
    min-width: 0;
}

.preview-info h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.preview-info p {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.preview-stats {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: var(--text-muted);
}

/* Download Options */
.download-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.download-option {
    background: var(--bg-secondary);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: var(--transition);
}

.download-option:hover {
    background: rgba(139, 92, 246, 0.1);
    border-color: var(--primary);
}

.option-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.option-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: var(--radius-xs);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.option-text h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.option-text p {
    font-size: 12px;
    color: var(--text-muted);
}

.option-download-btn {
    background: var(--primary);
    border: none;
    border-radius: var(--radius-xs);
    padding: 8px 16px;
    color: white;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.option-download-btn:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
}

/* Supported Platforms */
.supported-platforms {
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 24px;
}

.supported-platforms h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 20px;
    text-align: center;
}

.platform-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
}

.platform-item {
    background: var(--bg-secondary);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-sm);
    padding: 14px 12px;
    text-align: center;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 90px;
}

.platform-item:hover {
    background: rgba(139, 92, 246, 0.1);
    border-color: var(--primary);
    transform: translateY(-4px);
}

.platform-item svg {
    margin-bottom: 8px;
    color: var(--primary-light);
    flex-shrink: 0;
}

.platform-item .platform-icon {
    width: 32px;
    height: 32px;
    margin-bottom: 8px;
    object-fit: contain;
    flex-shrink: 0;
    border-radius: 8px;
}

.platform-item span {
    display: block;
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: 500;
    line-height: 1.3;
    text-align: center;
}

/* How to Use */
.how-to-use {
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 24px;
}

.how-to-use h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 20px;
    text-align: center;
}

.steps {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.step {
    display: flex;
    gap: 16px;
}

.step-number {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 16px;
    flex-shrink: 0;
}

.step-content h4 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.step-content p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Footer */
.footer {
    text-align: center;
    padding: 32px 20px;
    color: var(--text-secondary);
    font-size: 13px;
}

.footer p {
    margin-bottom: 8px;
}

.footer strong {
    color: var(--primary-light);
}

.footer-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.footer-links a {
    color: var(--primary-light);
    text-decoration: none;
    transition: var(--transition);
}

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

/* Responsive */
@media (max-width: 600px) {
    .platform-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .header-text h1 {
        font-size: 20px;
    }
    
    .logo {
        width: 40px;
        height: 40px;
    }
}
