/* Custom styles for episode grid */
.episodes-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.episodes-header h2 {
    margin: 0;
    font-size: 24px;
    color: #fff;
}

.episode-search-container {
    position: relative;
    display: flex;
    align-items: center;
    margin-right: 15px;
}

.episode-search-container .fas.fa-search {
    position: absolute;
    left: 10px;
    color: #888;
}

#episode-search {
    background-color: #222;
    border: 1px solid #333;
    border-radius: 5px;
    padding: 8px 10px 8px 35px;
    color: #eee;
    width: 250px;
    transition: all 0.3s ease;
}

#episode-search::placeholder {
    color: #888;
}

#episode-search:focus {
    border-color: #ff6600;
    box-shadow: 0 0 5px rgba(255, 102, 0, 0.5);
    outline: none;
}

.episodes-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

.view-switcher {
    display: flex;
    gap: 10px;
}

.view-switcher .fas {
    font-size: 20px;
    color: #888;
    cursor: pointer;
    transition: color 0.3s ease;
}

.view-switcher .fas:hover,
.view-switcher .fas.active {
    color: #ff6600;
}

.episodios-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    list-style: none;
    padding: 0;
    margin: 0;
    transition: all 0.3s ease;
}

.episodios-grid.episodios-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    grid-template-columns: unset;
}

.episode-card {
    background-color: #1a1a1a;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s ease-in-out, flex-direction 0.3s ease, width 0.3s ease;
    display: flex;
    flex-direction: column;
    width: 100%;
}

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

.episode-card a {
    text-decoration: none;
    color: inherit;
}

.episode-thumbnail {
    width: 100%;
    height: 120px;
    object-fit: cover;
    display: block;
    transition: width 0.3s ease, height 0.3s ease, border-radius 0.3s ease;
}

.episode-info {
    padding: 15px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.episode-label {
    font-size: 10px;
    color: #ff6600; /* Orange - AnimePlay theme */
    text-transform: uppercase;
    margin-bottom: 5px;
    font-weight: bold;
}

.episode-title {
    font-size: 13px;
    color: #fff;
    line-height: 1.3;
    margin: 0;
}

.episode-title a:hover {
    color: #ff6600; /* Orange - AnimePlay theme */
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .episodes-header {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    
    .episodes-header h2 {
        font-size: 18px;
        margin-bottom: 5px;
    }
    
    .episode-search-container {
        margin-right: 0;
        width: 100%;
        order: 2;
    }
    
    #episode-search {
        width: 100%;
        padding: 8px 10px 8px 35px;
        font-size: 14px;
    }
    
    .episodes-controls {
        order: 3;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 8px;
        width: 100%;
    }
    
    .view-switcher {
        gap: 8px;
        order: 1;
    }
    
    .view-switcher .fas {
        font-size: 18px;
    }
    
    .sort-buttons {
        gap: 6px;
        flex: 1;
    }
    
    .sort-btn {
        padding: 5px 8px;
        font-size: 11px;
        flex: 1;
        justify-content: center;
    }
    
    .sort-btn i {
        font-size: 10px;
    }
    
    .episodios-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 12px;
    }
}

@media (max-width: 480px) {
    .episodes-header h2 {
        font-size: 16px;
    }
    
    .episodes-controls {
        flex-wrap: wrap;
    }
    
    .view-switcher {
        width: 100%;
        justify-content: flex-start;
        order: 1;
    }
    
    .sort-buttons {
        width: 100%;
        order: 2;
    }
    
    .sort-btn {
        flex: 1;
        padding: 6px 8px;
        font-size: 10px;
    }
    
    .sort-btn i {
        display: none;
    }
    
    .episodios-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .episode-thumbnail {
        height: 100px;
    }
    
    .episode-info {
        padding: 10px;
    }
    
    .episode-label {
        font-size: 9px;
        margin-bottom: 3px;
    }
    
    .episode-title {
        font-size: 11px;
    }
}

/* List view (if implemented later) */
.episodios-grid.episodios-list .episode-card {
    flex-direction: row;
    align-items: center;
    background-color: #1a1a1a;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.episodios-grid.episodios-list .episode-thumbnail {
    width: 100px;
    height: 60px;
    border-radius: 8px 0 0 8px;
    flex-shrink: 0;
}

.episodios-grid.episodios-list .episode-info {
    padding: 10px 15px;
    flex: 1;
}

.episodios-grid.episodios-list .episode-label {
    margin-bottom: 2px;
    font-size: 11px;
}

.episodios-grid.episodios-list .episode-title {
    font-size: 14px;
    margin: 0;
}


/* Sort buttons styles */
.sort-buttons {
    display: flex;
    gap: 8px;
}

.sort-btn {
    background-color: transparent;
    border: 1px solid #ff6600;
    color: #ff6600;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: bold;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 5px;
}

.sort-btn:hover {
    background-color: #ff6600;
    color: #fff;
}

.sort-btn.active {
    background-color: #ff6600;
    color: #fff;
}

.sort-btn i {
    font-size: 12px;
}


