* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: #f0f2f5;
    color: #333;
    position: relative;
    overflow-x: hidden;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
    z-index: 1;
}

.helper-section {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    margin: 40px auto;
    max-width: 600px;
    padding: 0 20px;
}

.helper-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    overflow: hidden;
    background: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

.helper-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.speech-bubble {
    position: relative;
    background: #FE2C55;
    color: white;
    padding: 15px 20px;
    border-radius: 18px;
    font-size: 16px;
    box-shadow: 0 3px 10px rgba(254, 44, 85, 0.3);
    flex: 1;
}

.speech-bubble::before {
    content: '';
    position: absolute;
    left: -10px;
    top: 20px;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 10px 15px 10px 0;
    border-color: transparent #FE2C55 transparent transparent;
}

.speech-bubble p {
    margin: 0;
    font-weight: 500;
}

@media (max-width: 768px) {
    .helper-section {
        gap: 15px;
        margin: 30px auto;
    }
    
    .helper-avatar {
        width: 60px;
        height: 60px;
    }
    
    .speech-bubble {
        font-size: 14px;
        padding: 12px 16px;
    }
    
    .speech-bubble::before {
        top: 15px;
        border-width: 8px 12px 8px 0;
    }
}

h1 {
    text-align: center;
    color: #000;
    margin-bottom: 30px;
    font-size: 2.5rem;
    position: relative;
    z-index: 2;
}

.search-section {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    position: relative;
    z-index: 2;
}

#searchInput {
    flex: 1;
    padding: 12px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
}

#searchInput:focus {
    outline: none;
    border-color: #FE2C55;
}

#searchButton {
    padding: 12px 30px;
    background-color: #FE2C55;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s;
}

#searchButton:hover {
    background-color: #d62243;
}

.filter-section {
    text-align: center;
    margin-bottom: 20px;
}

.filter-section label {
    margin-right: 10px;
    font-weight: 500;
}

#sortOrder {
    padding: 8px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
    background-color: white;
    cursor: pointer;
}

.loading {
    text-align: center;
    padding: 50px;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #FE2C55;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.video-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

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

.video-thumbnail {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background-color: #f0f0f0;
}

.video-info {
    padding: 15px;
}

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

.video-stats {
    display: flex;
    gap: 15px;
    font-size: 14px;
    color: #666;
}

.stat {
    display: flex;
    align-items: center;
    gap: 5px;
}

.video-link {
    display: inline-block;
    margin-top: 10px;
    padding: 8px 16px;
    background-color: #000;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-size: 14px;
    transition: background-color 0.3s;
}

.video-link:hover {
    background-color: #333;
}

.error-message {
    text-align: center;
    padding: 40px;
    color: #666;
    font-size: 18px;
}