/* Modern Dark Theme with Glassmorphism */
:root {
    --bg-color: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.7);
    --primary: #3b82f6;
    --accent: #8b5cf6;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --glow: 0 0 20px rgba(139, 92, 246, 0.5);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow-y: auto;
    /* Changed from hidden to auto */
    position: relative;
}

/* Animated Background Globes */
.background-globes {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.globe {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.6;
    animation: float 10s infinite alternate ease-in-out;
}

.globe-1 {
    width: 300px;
    height: 300px;
    background: var(--primary);
    top: -50px;
    left: -50px;
}

.globe-2 {
    width: 400px;
    height: 400px;
    background: var(--accent);
    bottom: -100px;
    right: -100px;
    animation-delay: -5s;
}

@keyframes float {
    0% {
        transform: translate(0, 0);
    }

    100% {
        transform: translate(30px, 50px);
    }
}

/* Layout */
.container {
    width: 100%;
    max-width: 600px;
    padding: 2rem;
    text-align: center;
    z-index: 1;
}

header {
    margin-bottom: 3rem;
}

header h1 {
    font-size: 3rem;
    font-weight: 700;
    letter-spacing: -1px;
    margin-bottom: 0.5rem;
}

.highlight {
    background: linear-gradient(135deg, #8b5cf6, #3b82f6);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 800;
}

header p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

/* Glass Cards */
.card {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.hidden {
    display: none;
    opacity: 0;
    transform: translateY(20px);
}

/* Input Section */
.input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 1rem;
}

input {
    flex: 1;
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1rem 1.5rem;
    border-radius: 12px;
    color: white;
    font-size: 1rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.3s, box-shadow 0.3s;
}

input:focus {
    border-color: var(--accent);
    box-shadow: var(--glow);
}

.btn-glow {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border: none;
    padding: 0 1.5rem;
    border-radius: 12px;
    color: white;
    cursor: pointer;
    font-weight: 600;
    font-family: inherit;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-glow:hover {
    transform: scale(1.05);
    box-shadow: var(--glow);
}

.status {
    font-size: 0.9rem;
    color: var(--text-muted);
    min-height: 1.2em;
    margin-bottom: 1rem;
}

/* Input Grid */
.input-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
    width: 100%;
}

.input-card-lite {
    padding: 1.8rem !important;
    text-align: left;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.3s;
}

.input-card-lite:hover {
    transform: translateY(-5px);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 0.8rem;
}

.card-header .icon {
    font-size: 1.4rem;
}

.card-header h3 {
    font-size: 1.2rem;
    margin-bottom: 0;
    font-weight: 700;
}

.card-hint {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.platform-icons {
    margin-top: 1rem;
    display: flex;
    gap: 10px;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.4);
    font-weight: 600;
}

.platform-icons span {
    background: rgba(255, 255, 255, 0.05);
    padding: 2px 8px;
    border-radius: 4px;
}

.input-group {
    display: flex;
    gap: 10px;
}

.input-group input {
    flex: 1;
}

@media (max-width: 900px) {
    .input-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
}

@media (max-width: 600px) {
    .input-grid {
        grid-template-columns: 1fr;
    }

    header h1 {
        font-size: 3rem;
    }
}

/* Result Section */
.video-preview {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    height: auto;
    min-height: 200px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 1.5rem;
    font-size: 3rem;
}

.video-info h3 {
    margin-bottom: 0.5rem;
}

.desc-container {
    background: rgba(15, 23, 42, 0.4);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.desc-container p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 0 !important;
    text-align: left;
    flex: 1;
    display: -webkit-box;
    line-clamp: 3;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.btn-copy {
    background: rgba(139, 92, 246, 0.2);
    border: 1px solid var(--accent);
    color: var(--text-main);
    padding: 0.5rem 0.8rem;
    border-radius: 8px;
    font-size: 0.8rem;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s, transform 0.2s;
}

.btn-copy:hover {
    background: var(--accent);
    transform: scale(1.05);
}

.video-info p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.btn-tiktok {
    width: 100%;
    background: #000;
    /* TikTok Black */
    color: white;
    border: 1px solid #333;
    padding: 1rem;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    transition: background 0.3s;
}

.btn-tiktok:hover:not(:disabled) {
    background: #111;
    border-color: #555;
}

.btn-tiktok:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Animations */
@keyframes pulse {
    0% {
        opacity: 0.5;
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 0.5;
    }
}

.loading {
    animation: pulse 1.5s infinite;
}

/* Local Loader Styles */
.local-loader {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 1.5rem;
    padding: 0.8rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.spinner-sm {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-left-color: var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.local-loader-text {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.local-progress-container {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 2px;
    margin-top: 0.5rem;
    overflow: hidden;
}

.local-progress-bar {
    width: 0%;
    height: 100%;
    background: linear-gradient(to right, var(--primary), var(--accent));
    transition: width 0.3s ease;
}

.actions {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.btn-download {
    flex: 1;
    background: linear-gradient(135deg, #10b981, #059669);
    /* Green gradient */
    color: white;
    text-decoration: none;
    padding: 1rem;
    border-radius: 12px;
    font-weight: 600;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-download:hover {
    transform: scale(1.02);
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.4);
}

.btn-tiktok {
    flex: 2;
}

/* Info Sections */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 3rem;
    text-align: left;
    width: 100%;
}

.full-width {
    grid-column: 1 / -1;
}

.info-card {
    padding: 1.5rem;
    height: 100%;
}

.info-card .icon {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.info-card h3 {
    margin-bottom: 1rem;
    color: var(--accent);
}

.info-card ul,
.info-card ol {
    padding-left: 1.2rem;
    color: var(--text-muted);
}

.info-card li {
    margin-bottom: 0.5rem;
}

.features-list {
    list-style: none;
    padding-left: 0 !important;
}

.features-list li::before {
    content: "✅";
    margin-right: 10px;
}

/* Footer */
footer {
    margin-top: 4rem;
    padding: 2rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.footer-note {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

.tiktok-status-msg {
    font-size: 0.8rem;
    color: #ef4444;
    /* red-500 */
    margin-top: 10px;
}

@media (max-width: 600px) {
    header h1 {
        font-size: 2.2rem;
    }

    .container {
        padding: 1rem;
    }
}