/* Component Styles for TikTok Downloader */

/* Feature Icons */
.feature-icon {
    position: relative;
}

.feature-icon::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background: #8b5cf6;
    border-radius: 50%;
    filter: blur(15px);
    opacity: 0.3;
    z-index: -1;
}

/* Mobile Menu Styles */
#mobile-menu {
    visibility: hidden;
    transform: translateX(100%);
    transition: all 0.3s ease;
    opacity: 0;
    pointer-events: none;
    z-index: 1000;
}

#mobile-menu.active {
    visibility: visible;
    transform: translateX(0);
    opacity: 1;
    pointer-events: auto;
}

/* Step Cards */
.step-card {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.step-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(109, 40, 217, 0.1) 0%, rgba(37, 99, 235, 0.1) 100%);
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.step-card:hover::before {
    opacity: 1;
}

.step-number {
    position: relative;
    z-index: 1;
}

.step-number::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #6d28d9 0%, #2563eb 100%);
    border-radius: 50%;
    z-index: -1;
}

/* FAQ Accordion */
.faq-item {
    transition: all 0.3s ease;
}

.faq-item.active {
    border-color: #8b5cf6;
}

.faq-question {
    cursor: pointer;
    user-select: none;
}

.faq-toggle {
    transition: transform 0.3s ease;
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    margin-top: 0;
    visibility: hidden;
    transition: max-height 0.3s ease-out, opacity 0.3s ease-out, margin 0.3s ease-out, visibility 0.3s ease-out;
}

.faq-item.active .faq-answer {
    max-height: 1000px; /* Increased to accommodate larger answers */
    opacity: 1;
    margin-top: 0.5rem;
    visibility: visible;
}

.faq-item.active .faq-toggle {
    transform: rotate(45deg);
}

/* Download Buttons */
.download-btn {
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.download-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    z-index: -1;
}

.download-btn:hover::before {
    left: 0;
}

/* Video Format Selector */
.format-toggle-btn {
    transition: all 0.3s ease;
    cursor: pointer;
}

.format-toggle-btn:hover {
    background-color: #f3f4f6;
}

.format-options {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.format-options.show {
    max-height: 500px;
}

.format-item {
    transition: all 0.2s ease;
}

.format-item:hover {
    background-color: #f3f4f6;
}

/* Video Card */
.video-card {
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transition: transform 0.2s ease;
    max-width: 100%;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
}

.video-card:hover {
    transform: translateY(-5px);
}

.video-card .aspect-w-9 {
    position: relative;
    padding-bottom: 177.78%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
}

.video-card .aspect-w-9 img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

/* Input Field Styles */
.input-container {
    position: relative;
}

.input-icon {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
}

.input-field {
    transition: all 0.3s ease;
}

.input-field:focus {
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.3);
}

/* Loading Spinner */
.spinner {
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top: 3px solid #fff;
    width: 24px;
    height: 24px;
    animation: spin 1s linear infinite;
    display: inline-block;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Formats Modal */
#formats-modal {
    transition: all 0.3s ease;
}

#formats-modal .bg-white {
    animation: modalFadeIn 0.3s ease forwards;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

#formats-modal .formats-list {
    overflow-y: auto;
    max-height: calc(80vh - 70px); /* Account for header */
    padding-right: 5px;
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
    scroll-behavior: smooth;
}

/* Ensure the modal header stays fixed during scrolling */
#formats-modal .bg-white > div:first-child {
    background-color: white;
    z-index: 2;
    position: sticky;
    top: 0;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Format Options Styling */
.formats-list .format-option {
    border: 1px solid #f3f4f6;
    border-radius: 0.75rem;
    padding: 1rem;
    transition: all 0.2s ease;
    background-color: #f9fafb;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.formats-list .format-option:hover {
    background-color: #f3f4f6;
    border-color: #e5e7eb;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.format-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.025em;
}

.format-badge.hd {
    background-color: rgba(4, 120, 87, 0.1);
    color: #047857;
}

.format-badge.sd {
    background-color: rgba(29, 78, 216, 0.1);
    color: #1d4ed8;
}

.format-size {
    color: #6b7280;
    font-size: 0.875rem;
}

.download-format-btn {
    transition: all 0.2s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    min-width: 110px;
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    background-color: #e5e7eb;
    color: #374151;
}

.download-format-btn:hover {
    background-color: #d1d5db;
}

@media (max-width: 767px) {
    .format-option .download-format-btn {
        width: 100%;
        padding: 0.625rem;
        margin-top: 0.25rem;
    }
    
    .format-size {
        font-size: 0.75rem;
    }
    
    .formats-list .format-option {
        padding: 0.875rem;
        margin-bottom: 0.75rem;
    }
}

.format-option .download-format-btn.secondary.bg-green-600 {
    background-color: #059669;
    color: white;
}

/* Video Progress Bar */
.video-progress-container {
    width: 80px;
    height: 18px;
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    overflow: hidden;
    margin: 0 5px;
}

.video-progress-bar {
    height: 100%;
    background: #fff;
    color: #6d28d9;
    text-align: center;
    font-size: 12px;
    line-height: 18px;
    border-radius: 10px;
    transition: width 0.3s ease;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: bold;
}

/* Download Button Progress */
.download-btn {
    position: relative;
    overflow: hidden;
}

.download-btn.progress-mode {
    background: #f3f4f6;
    color: #111827;
}

.progress-overlay {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0%;
    background: linear-gradient(135deg, #6d28d9 0%, #2563eb 100%);
    z-index: 0;
    transition: width 0.3s ease;
}

.download-btn.progress-mode .download-text,
.download-btn.progress-mode .download-icon {
    position: relative;
    z-index: 1;
    color: white;
    mix-blend-mode: difference;
}

.success-icon {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.success-icon svg {
    margin-right: 0.5rem;
}

/* Smaller spinner for format buttons */
.download-format-btn .spinner {
    width: 18px;
    height: 18px;
    border-width: 2px;
}

/* Button Spinner */
.button-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    border-top-color: #ffffff;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
} 