/* =========================================================
   TikTok Video Downloader - Kadence Edition Professional Styles
   ========================================================= */

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

.cui-wrapper {
    margin: 24px 0;
    width: 100%;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

.cui-container {
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
    box-shadow:
        0 4px 6px -1px rgba(0, 0, 0, 0.05),
        0 10px 25px -5px rgba(0, 0, 0, 0.08);
    transition: box-shadow 0.3s ease;
}

.cui-container:hover {
    box-shadow:
        0 8px 15px -3px rgba(0, 0, 0, 0.08),
        0 20px 35px -8px rgba(0, 0, 0, 0.12);
}

/* ── Input Row Group ── */
.cui-input-wrapper {
    width: 100%;
}

.cui-input-group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.cui-input {
    flex: 1 1 300px;
    padding: 0 18px;
    box-sizing: border-box;
    font-family: inherit;
    font-size: 0.96rem;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    min-height: 52px;
}

.cui-input:focus {
    border-color: #5e54d3 !important;
    box-shadow: 0 0 0 3px rgba(94, 84, 211, 0.18);
}

/* ── Paste Button ── */
.tt-paste-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0 18px;
    height: 52px;
    font-family: inherit;
    font-size: 0.92rem;
    font-weight: 600;
    color: #ffffff;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(16, 185, 129, 0.25);
    white-space: nowrap;
}

.tt-paste-btn:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35);
}

.tt-paste-btn.tt-pasted {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
}

/* ── Download Trigger Button ── */
.cui-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 24px;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    text-decoration: none;
    border: none;
    cursor: pointer;
    min-height: 52px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(94, 84, 211, 0.25);
    transition: all 0.2s ease;
    white-space: nowrap;
}

.cui-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(94, 84, 211, 0.35);
    filter: brightness(1.05);
}

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

.cui-btn-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* ── Message Alert ── */
.cui-message {
    margin-top: 14px;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1.4;
}

.cui-message.cui-error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.cui-message.cui-success {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

/* ── Video Preview Card ── */
.tiktok-video-preview {
    width: 100%;
}

.tt-preview-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 20px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
}

.tt-preview-header {
    display: flex;
    gap: 18px;
    align-items: flex-start;
    margin-bottom: 20px;
}

.tt-thumb-box {
    position: relative;
    width: 110px;
    height: 140px;
    flex-shrink: 0;
    border-radius: 10px;
    overflow: hidden;
    background: #0f172a;
}

.tt-thumb-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.tt-duration-badge {
    position: absolute;
    bottom: 6px;
    right: 6px;
    background: rgba(0, 0, 0, 0.75);
    color: #ffffff;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    backdrop-filter: blur(4px);
}

.tt-details-box {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.tt-video-title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.tt-video-author {
    margin: 0;
    font-size: 0.88rem;
    color: #64748b;
    font-weight: 500;
}

.tt-video-stats {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.tt-stat-badge {
    background: #e0e7ff;
    color: #4338ca;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 6px;
}

.tt-stat-item {
    font-size: 0.82rem;
    color: #475569;
    font-weight: 600;
}

/* ── Download Buttons Group ── */
.tt-download-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    margin-top: 16px;
}

.tt-dl-btn {
    width: 100%;
    text-align: center;
    border-radius: 10px !important;
    min-height: 48px !important;
}

.tt-btn-primary {
    background: linear-gradient(135deg, #5e54d3 0%, #4338ca 100%) !important;
    color: #ffffff !important;
}

.tt-btn-success {
    background: linear-gradient(135deg, #10b981 0%, #047857 100%) !important;
    color: #ffffff !important;
}

.tt-btn-audio {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
    color: #ffffff !important;
}

/* ── Download Another Button ── */
.tt-another-container {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid #f1f5f9;
    text-align: center;
}

.tt-another-btn {
    background: transparent;
    border: 1.5px solid #cbd5e1;
    color: #475569;
    font-size: 0.9rem;
    font-weight: 600;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tt-another-btn:hover {
    background: #f8fafc;
    color: #0f172a;
    border-color: #94a3b8;
}

/* Spinner */
@keyframes cuiSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.cui-spin {
    animation: cuiSpin 0.8s linear infinite;
}

/* ── Responsive ── */
@media (max-width: 640px) {
    .cui-input-group {
        flex-direction: column;
        align-items: stretch;
    }

    .cui-input,
    .tt-paste-btn,
    .cui-btn {
        width: 100%;
        min-width: unset;
    }

    .tt-preview-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .tt-details-box {
        align-items: center;
    }
}