/* ============================================================
   DownloadTT - Premium TikTok Downloader Custom Styles
   Stunning warm Sunset Coral, Orange, & Gold Glassmorphic Theme
   ============================================================ */

/* --- Wrapper & Container --- */
.downloadtt-wrapper {
    max-width: 760px;
    margin: 45px auto;
    padding: 0 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.downloadtt-container {
    background: linear-gradient(135deg, #0f0c20 0%, #15102a 50%, #201435 100%);
    border-radius: 24px;
    padding: 45px 35px;
    box-shadow: 0 25px 65px rgba(0, 0, 0, 0.45), 0 0 50px rgba(255, 94, 98, 0.08);
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 94, 98, 0.15);
}

.downloadtt-container::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 20% 30%, rgba(255, 94, 98, 0.09), transparent 45%),
                radial-gradient(circle at 80% 70%, rgba(255, 174, 51, 0.07), transparent 45%);
    pointer-events: none;
}

/* --- Form --- */
.downloadtt-form {
    position: relative;
    z-index: 2;
}

.downloadtt-input-group {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1.5px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 8px 8px 8px 20px;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    backdrop-filter: blur(12px);
}

.downloadtt-input-group:focus-within {
    border-color: rgba(255, 94, 98, 0.6);
    box-shadow: 0 0 25px rgba(255, 94, 98, 0.18);
    background: rgba(255, 255, 255, 0.08);
}

.downloadtt-icon {
    width: 24px;
    height: 24px;
    color: rgba(255, 94, 98, 0.5);
    flex-shrink: 0;
    margin-right: 14px;
}

#downloadtt-url {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #fff9f5;
    font-size: 16px;
    padding: 12px 6px;
    font-family: inherit;
}

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

/* --- Button --- */
.downloadtt-btn {
    background: linear-gradient(135deg, #ff416c, #ff4b2b);
    color: #fff;
    border: none;
    border-radius: 12px;
    padding: 14px 32px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    flex-shrink: 0;
    font-family: inherit;
    position: relative;
    box-shadow: 0 4px 15px rgba(255, 65, 108, 0.35);
}

.downloadtt-btn:hover {
    background: linear-gradient(135deg, #ff4b2b, #ff416c);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 65, 108, 0.5);
}

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

/* --- Spinner --- */
.downloadtt-spinner {
    width: 22px;
    height: 22px;
    border: 3.5px solid rgba(255, 255, 255, 0.25);
    border-top-color: #fff;
    border-radius: 50%;
    animation: downloadtt-spin 0.65s linear infinite;
    margin: 0 auto;
}

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

/* --- Error --- */
.downloadtt-error {
    margin-top: 18px;
    padding: 14px 20px;
    background: rgba(255, 75, 43, 0.1);
    border: 1px solid rgba(255, 75, 43, 0.25);
    border-radius: 12px;
    color: #ff7675;
    font-size: 14.5px;
    text-align: center;
    font-weight: 500;
}

/* ============================================================
   REDESIGNED METADATA CARD LAYOUT
   ============================================================ */
.downloadtt-result {
    margin-top: 30px;
    background: linear-gradient(135deg, #120e24 0%, #1e1335 100%);
    border-radius: 24px;
    padding: 30px;
    box-shadow: 0 15px 45px rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.05);
    animation: downloadtt-fadeIn 0.4s ease-out;
}

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

.downloadtt-card {
    display: flex;
    flex-direction: row;
    gap: 30px;
    align-items: stretch;
}

.downloadtt-media-container {
    width: 200px;
    position: relative;
    border-radius: 18px;
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.downloadtt-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    aspect-ratio: 9 / 16;
}

.downloadtt-duration-badge {
    position: absolute;
    bottom: 12px;
    right: 12px;
    background: rgba(18, 14, 36, 0.85);
    color: #ffae33;
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 700;
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.downloadtt-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-width: 0;
}

.downloadtt-meta-header {
    margin-bottom: 15px;
}

.downloadtt-author-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.downloadtt-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #ff416c;
}

.downloadtt-author-names {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.downloadtt-nickname {
    color: #fff;
    font-weight: 700;
    font-size: 16px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.downloadtt-username {
    color: #ffae33;
    font-size: 13.5px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.downloadtt-description {
    color: #e5dfec;
    font-size: 15px;
    line-height: 1.55;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
}

/* --- Action Buttons --- */
.downloadtt-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 20px;
}

.downloadtt-dl-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 24px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 15px;
    text-decoration: none !important;
    transition: all 0.25s cubic-bezier(0.25, 0.8, 0.25, 1);
    text-align: center;
}

.downloadtt-dl-video {
    background: linear-gradient(135deg, #ff416c, #ff4b2b);
    color: #fff !important;
    box-shadow: 0 4px 15px rgba(255, 65, 108, 0.25);
}

.downloadtt-dl-video:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 65, 108, 0.45);
}

.downloadtt-dl-audio {
    background: rgba(255, 255, 255, 0.07);
    color: #ffae33 !important;
    border: 1px solid rgba(255, 174, 51, 0.3);
}

.downloadtt-dl-audio:hover {
    background: rgba(255, 174, 51, 0.12);
    border-color: rgba(255, 174, 51, 0.6);
    transform: translateY(-2px);
}

/* ============================================================
   PREMIUM 32 LANGUAGE SWITCHER - Glitch-Free
   ============================================================ */
.downloadtt-lang-switcher {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.downloadtt-lang-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(18, 12, 36, 0.95);
    color: #fff9f5;
    border: 1px solid rgba(255, 94, 98, 0.25);
    border-radius: 12px;
    padding: 10px 18px;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    backdrop-filter: blur(20px);
    transition: all 0.3s ease;
    font-family: inherit;
    position: relative;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.25);
}

.downloadtt-lang-btn:hover {
    background: #180c2c;
    border-color: rgba(255, 94, 98, 0.6);
}

.downloadtt-lang-dropdown {
    display: none;
    position: absolute;
    bottom: 100%;
    right: 0;
    margin-bottom: 0; /* Key: zero-gap */
    background: rgba(18, 12, 36, 0.97);
    border: 1px solid rgba(255, 94, 98, 0.2);
    border-radius: 14px;
    padding: 8px;
    padding-bottom: 14px; /* Bridge spacing */
    width: 220px;
    max-height: 330px;
    overflow-y: auto;
    backdrop-filter: blur(25px);
    box-shadow: 0 12px 45px rgba(0, 0, 0, 0.55);
}

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

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

.downloadtt-lang-item:hover {
    background: rgba(255, 65, 108, 0.15);
    color: #fff !important;
}

.downloadtt-lang-item.active {
    background: rgba(255, 65, 108, 0.25);
    color: #fff !important;
    font-weight: 700;
}

/* --- Dropdown Scrollbar --- */
.downloadtt-lang-dropdown::-webkit-scrollbar {
    width: 5px;
}
.downloadtt-lang-dropdown::-webkit-scrollbar-track {
    background: transparent;
}
.downloadtt-lang-dropdown::-webkit-scrollbar-thumb {
    background: rgba(255, 94, 98, 0.25);
    border-radius: 10px;
}

/* ============================================================
   RESPONSIVE LAYOUTS
   ============================================================ */
@media (max-width: 680px) {
    .downloadtt-container {
        padding: 30px 20px;
    }
    
    .downloadtt-input-group {
        flex-direction: column;
        padding: 12px;
        gap: 12px;
    }
    
    .downloadtt-icon {
        display: none;
    }
    
    #downloadtt-url {
        width: 100%;
        text-align: center;
        padding: 8px 0;
    }
    
    .downloadtt-btn {
        width: 100%;
        padding: 14px;
    }
    
    /* Result Card Stacked Layout for Mobile */
    .downloadtt-card {
        flex-direction: column;
        gap: 20px;
        align-items: center;
        text-align: center;
    }
    
    .downloadtt-media-container {
        width: 100%;
        max-width: 220px;
        height: auto;
    }

    .downloadtt-thumbnail {
        width: 100%;
        height: auto;
        aspect-ratio: 9 / 16;
    }
    
    .downloadtt-author-row {
        justify-content: center;
    }
    
    .downloadtt-details {
        width: 100%;
    }
    
    .downloadtt-lang-switcher {
        bottom: 12px;
        right: 12px;
    }
}
