/* ============================================================
   TikDown - Premium TikTok Video Downloader Styles v2
   ============================================================ */

/* --- Wrapper & Container --- */
.tikdown-wrapper {
    max-width: 680px;
    margin: 40px auto;
    padding: 0 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.tikdown-container {
    background: linear-gradient(145deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    border-radius: 20px;
    padding: 40px 30px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3), 0 0 40px rgba(83, 92, 236, 0.1);
    position: relative;
    overflow: hidden;
}

.tikdown-container::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 50%, rgba(83, 92, 236, 0.08), transparent 50%),
                radial-gradient(circle at 70% 80%, rgba(255, 0, 80, 0.06), transparent 50%);
    pointer-events: none;
}

/* --- Form --- */
.tikdown-form {
    position: relative;
    z-index: 1;
}

.tikdown-input-group {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    padding: 6px 6px 6px 16px;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.tikdown-input-group:focus-within {
    border-color: rgba(83, 92, 236, 0.6);
    box-shadow: 0 0 20px rgba(83, 92, 236, 0.15);
    background: rgba(255, 255, 255, 0.1);
}

.tikdown-icon {
    width: 22px;
    height: 22px;
    color: rgba(255, 255, 255, 0.4);
    flex-shrink: 0;
    margin-right: 12px;
}

#tikdown-url {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #ffffff;
    font-size: 15px;
    padding: 12px 8px;
    font-family: inherit;
}

#tikdown-url::placeholder {
    color: rgba(255, 255, 255, 0.35);
}

/* --- Button --- */
.tikdown-btn {
    background: linear-gradient(135deg, #535cec, #7c4dff);
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 12px 28px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
    font-family: inherit;
    position: relative;
    overflow: hidden;
}

.tikdown-btn:hover {
    background: linear-gradient(135deg, #4a52d4, #6b3de8);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(83, 92, 236, 0.4);
}

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

/* --- Spinner --- */
.tikdown-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: tikdown-spin 0.7s linear infinite;
    margin: 0 auto;
}

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

/* --- Error --- */
.tikdown-error {
    margin-top: 14px;
    padding: 12px 16px;
    background: rgba(255, 59, 48, 0.12);
    border: 1px solid rgba(255, 59, 48, 0.25);
    border-radius: 10px;
    color: #ff6b6b;
    font-size: 14px;
    text-align: center;
}

/* --- Result --- */
.tikdown-result {
    margin-top: 24px;
    background: linear-gradient(145deg, #1a1a2e 0%, #16213e 100%);
    border-radius: 20px;
    padding: 24px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.tikdown-result-inner {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.tikdown-thumbnail {
    width: 140px;
    height: 180px;
    object-fit: cover;
    border-radius: 12px;
    flex-shrink: 0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

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

.tikdown-title {
    color: #fff;
    font-size: 15px;
    line-height: 1.5;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.tikdown-author {
    color: rgba(255, 255, 255, 0.5);
    font-size: 13px;
    margin-bottom: 6px;
}

.tikdown-duration {
    color: rgba(255, 255, 255, 0.4);
    font-size: 12px;
    margin-bottom: 16px;
}

.tikdown-btn-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tikdown-download-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #00c853, #00e676);
    color: #fff;
    text-decoration: none;
    padding: 12px 24px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
}

.tikdown-download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 200, 83, 0.4);
    color: #fff;
    text-decoration: none;
}

/* --- Language Switcher --- */
.tikdown-lang-switcher {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.tikdown-lang-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(26, 26, 46, 0.95);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    padding: 10px 16px;
    font-size: 13px;
    cursor: pointer;
    backdrop-filter: blur(20px);
    transition: all 0.3s ease;
    font-family: inherit;
}

.tikdown-lang-btn:hover {
    background: rgba(26, 26, 46, 1);
    border-color: rgba(83, 92, 236, 0.5);
}

.tikdown-lang-dropdown {
    display: none;
    position: absolute;
    bottom: 100%;
    right: 0;
    margin-bottom: 8px;
    background: rgba(26, 26, 46, 0.97);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    padding: 8px;
    width: 200px;
    max-height: 320px;
    overflow-y: auto;
    backdrop-filter: blur(20px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

.tikdown-lang-switcher:hover .tikdown-lang-dropdown {
    display: block;
}

.tikdown-lang-item {
    display: block;
    padding: 8px 14px;
    color: rgba(255, 255, 255, 0.75);
    text-decoration: none;
    font-size: 13px;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.tikdown-lang-item:hover {
    background: rgba(83, 92, 236, 0.2);
    color: #fff;
    text-decoration: none;
}

.tikdown-lang-item.active {
    background: rgba(83, 92, 236, 0.3);
    color: #fff;
    font-weight: 600;
}

/* --- Scrollbar --- */
.tikdown-lang-dropdown::-webkit-scrollbar {
    width: 4px;
}

.tikdown-lang-dropdown::-webkit-scrollbar-track {
    background: transparent;
}

.tikdown-lang-dropdown::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}

/* --- Responsive --- */
@media (max-width: 600px) {
    .tikdown-container {
        padding: 24px 16px;
    }
    .tikdown-input-group {
        flex-direction: column;
        padding: 12px;
        gap: 10px;
    }
    .tikdown-icon {
        display: none;
    }
    #tikdown-url {
        width: 100%;
        padding: 10px 4px;
    }
    .tikdown-btn {
        width: 100%;
        padding: 14px;
    }
    .tikdown-result-inner {
        flex-direction: column;
        text-align: center;
    }
    .tikdown-thumbnail {
        width: 100%;
        height: 220px;
    }
    .tikdown-btn-group {
        justify-content: center;
    }
    .tikdown-lang-switcher {
        bottom: 12px;
        right: 12px;
    }
}
