*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    background: #121212;
    color: white;
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
}

.main-container {
    width: 100%;
    max-width: 1200px;
    padding: 1rem;
    padding-top: 100px;
}

.controls {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 1200px;
    background: rgba(30, 30, 30, 0.95);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.7);
    padding: 15px 20px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    z-index: 9999;
    user-select: none;
}

.search-bar {
    width: 100%;
    max-width: 500px;
    padding: 0.5rem;
    font-size: 1rem;
    border-radius: 8px;
    border: solid 3px #6ab04c;
}

.order-select {
    width: 180px;
    padding: 0.4rem;
    font-size: 1rem;
    border-radius: 4px;
    border: none;
    background: #1e1e1e;
    color: white;
    cursor: pointer;
}

button {
    padding: 0.5rem 1rem;
    border-radius: 4px;
    border: none;
    background: #6ab04c;
    color: white;
    font-weight: bold;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.3s ease;
}

button:hover:not(:disabled) {
    background: #519636;
}

button:disabled {
    opacity: 0.5;
    cursor: default;
}

.videos {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    padding: 0 1rem;
}

.video-card {
    background: #1e1e1e;
    border-radius: 8px;
    flex: 1 1 300px;
    max-width: 33%;
    min-width: 280px;
    overflow: hidden;
    padding-bottom: 0.5rem;
}

.video-card img {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    display: block;
}

.video-card h4 {
    margin: 0.5rem;
    font-size: 1rem;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.video-info {
    margin: 0 0.5rem 0.5rem;
    font-size: 0.875rem;
    color: #ccc;
    text-align: center;
}

.channel-link {
    color: #6ab04c;
    text-decoration: none;
    cursor: pointer;
}

.channel-link:hover {
    text-decoration: underline;
}

.channel-name {
    margin-top: 20px;
    margin-bottom: 5px;
}

.categories {
    margin-bottom: 10px;
}

.category-link {
    color: #f1c40f;
    text-decoration: none;
    cursor: pointer;
}

.category-link:hover {
    text-decoration: underline;
}

.links {
    margin-bottom: 10px;
}

.links a {
    display: inline-block;
    margin: 0 6px 6px 0;
    padding: 6px 12px;
    background-color: #6ab04c;
    /* verde parecido com canal */
    color: rgb(0, 0, 0) !important;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: background-color 0.3s ease;
}

.links a:hover {
    background-color: #519636;
    /* verde mais escuro no hover */
    text-decoration: none;
}

#channelCounts {
    max-width: 800px;
    margin: 0 auto 1rem auto;
    color: #6ab04c;
    font-weight: bold;
    text-align: center;
    font-size: 0.9rem;
    user-select: none;
}

@media (max-width: 600px) {
    #paginationControls button {
        padding: 6px 10px;
        font-size: 0.9rem;
    }

    @media (max-width: 768px) {
        .video-card {
            flex: 1 1 100%;
            max-width: 100%;
        }

        .controls {
            flex-direction: column;
            align-items: center;
        }

        .search-bar,
        .order-select {
            width: 100%;
            max-width: 100%;
        }

        .main-container {
            padding-top: 210px;
        }
    }
}
