/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 40px;
    color: white;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.logo i {
    color: #ff0000;
    font-size: 3rem;
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    font-weight: 400;
}

/* Tab Navigation */
.tab-navigation {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 40px;
}

.tab-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 25px;
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.tab-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-2px);
}

.tab-btn.active {
    background: white;
    color: #667eea;
    border-color: white;
    box-shadow: 0 8px 25px rgba(255, 255, 255, 0.2);
}

.tab-btn i {
    font-size: 1.1rem;
}

/* Tab Content */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Search Section */
.search-section {
    margin-bottom: 40px;
}

.search-container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.search-box {
    display: flex;
    align-items: center;
    background: white;
    border-radius: 50px;
    padding: 8px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

.search-box:focus-within {
    box-shadow: 0 12px 35px rgba(102, 126, 234, 0.3);
    transform: translateY(-2px);
}

.search-icon {
    color: #667eea;
    font-size: 1.2rem;
    margin: 0 15px;
}

#searchInput {
    flex: 1;
    border: none;
    outline: none;
    font-size: 1.1rem;
    padding: 15px 0;
    background: transparent;
}

#searchInput::placeholder {
    color: #999;
}

.search-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 40px;
    padding: 15px 25px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.search-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

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

/* Quick Tags */
.quick-tags {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.tag-label {
    color: #666;
    font-weight: 500;
    margin-right: 5px;
}

.tag {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 20px;
    padding: 8px 16px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tag:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

/* Loading */
.loading {
    text-align: center;
    padding: 60px 20px;
    color: white;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

/* Results Section */
.results-section {
    flex: 1;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    color: white;
}

.results-header h2 {
    font-size: 1.8rem;
    font-weight: 600;
}

.result-count {
    background: rgba(255, 255, 255, 0.2);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
}

/* Video Grid */
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 25px;
}

.video-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
}

.video-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.video-thumbnail {
    position: relative;
    width: 100%;
    height: 180px;
    overflow: hidden;
}

.video-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.video-card:hover .video-thumbnail img {
    transform: scale(1.05);
}

.similarity-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

.video-info {
    padding: 20px;
}

.video-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 8px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.video-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.video-description {
    color: #888;
    font-size: 0.9rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: white;
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.8;
}

.empty-state h3 {
    font-size: 1.8rem;
    margin-bottom: 10px;
    font-weight: 600;
}

.empty-state p {
    font-size: 1.1rem;
    opacity: 0.9;
    margin-bottom: 40px;
}

.features {
    display: flex;
    justify-content: center;
    gap: 40px;
    flex-wrap: wrap;
}

.feature {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.1);
    padding: 15px 20px;
    border-radius: 25px;
    backdrop-filter: blur(10px);
}

.feature i {
    font-size: 1.2rem;
}

/* Error Message */
.error-message {
    background: #ff4757;
    color: white;
    padding: 15px 20px;
    border-radius: 10px;
    margin: 20px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Footer */
.footer {
    text-align: center;
    padding: 30px 0;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
}

/* Realtime Search Form */
.realtime-search-form {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.input-group label {
    color: #333;
    font-weight: 600;
    font-size: 1rem;
}

.input-wrapper {
    display: flex;
    align-items: center;
    background: white;
    border-radius: 15px;
    padding: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.input-wrapper:focus-within {
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
    transform: translateY(-2px);
}

.input-icon {
    color: #667eea;
    font-size: 1.1rem;
    margin: 0 12px;
}

.input-wrapper input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 1rem;
    padding: 12px 0;
    background: transparent;
}

.input-wrapper input::placeholder {
    color: #999;
}

.realtime-btn {
    align-self: center;
    margin-top: 10px;
    padding: 15px 30px;
    font-size: 1.1rem;
}

/* Progress Section */
.progress-section {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 30px;
    margin-top: 30px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.progress-header h3 {
    color: #333;
    font-size: 1.3rem;
    font-weight: 600;
    margin: 0;
}

.progress-percent {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 1rem;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 15px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
    transition: width 0.3s ease;
    width: 0%;
}

.progress-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.progress-text {
    color: #666;
    font-size: 0.95rem;
}

.cancel-btn {
    background: #ff4757;
    color: white;
    border: none;
    border-radius: 20px;
    padding: 8px 16px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.cancel-btn:hover {
    background: #ff3742;
    transform: translateY(-1px);
}

/* Utility Classes */
.hidden {
    display: none !important;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .logo {
        font-size: 2rem;
    }
    
    .logo i {
        font-size: 2.5rem;
    }
    
    .search-container {
        padding: 20px;
    }
    
    .search-box {
        flex-direction: column;
        gap: 15px;
        padding: 20px;
        border-radius: 20px;
    }
    
    #searchInput {
        text-align: center;
        padding: 10px 0;
    }
    
    .search-btn {
        align-self: stretch;
        justify-content: center;
        border-radius: 15px;
    }
    
    .quick-tags {
        justify-content: center;
    }
    
    .video-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .features {
        flex-direction: column;
        gap: 15px;
    }
    
    .results-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .tab-navigation {
        flex-direction: column;
        gap: 10px;
        margin-bottom: 30px;
    }

    .tab-btn {
        justify-content: center;
        padding: 15px 20px;
    }

    .realtime-search-form {
        gap: 20px;
    }

    .progress-section {
        padding: 20px;
        margin-top: 20px;
    }

    .progress-header {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }

    .progress-details {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
}
